diff --git a/k8s-openapi-codegen/src/fixups.rs b/k8s-openapi-codegen/src/fixups.rs index 30613778ea..4c5bd0325a 100644 --- a/k8s-openapi-codegen/src/fixups.rs +++ b/k8s-openapi-codegen/src/fixups.rs @@ -52,7 +52,7 @@ pub(crate) fn deployment_rollback_create_response_type(spec: &mut crate::swagger if let Some(operation) = spec.operations.iter_mut().find(|o| o.id == "createAppsV1beta1NamespacedDeploymentRollback") { for response in operation.responses.values_mut() { - if let Some(crate::swagger20::Schema { kind: crate::swagger20::SchemaKind::Ref(crate::swagger20::RefPath(ref_path)), .. }) = response { + if let crate::swagger20::Schema { kind: crate::swagger20::SchemaKind::Ref(crate::swagger20::RefPath(ref_path)), .. } = response { if ref_path == "io.k8s.api.apps.v1beta1.DeploymentRollback" { std::mem::replace(ref_path, "io.k8s.apimachinery.pkg.apis.meta.v1.Status".to_string()); found = true; @@ -527,11 +527,11 @@ pub(crate) fn separate_watch_from_list_operations(spec: &mut crate::swagger20::S watch_operation.parameters[watch_index] = watch_parameter.clone(); watch_operation.parameters.swap_remove(std::cmp::max(continue_index, limit_index)); watch_operation.parameters.swap_remove(std::cmp::min(continue_index, limit_index)); - watch_operation.responses.insert(reqwest::StatusCode::OK, Some(crate::swagger20::Schema { + watch_operation.responses.insert(reqwest::StatusCode::OK, crate::swagger20::Schema { description: None, kind: crate::swagger20::SchemaKind::Ref(crate::swagger20::RefPath("io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent".to_owned())), kubernetes_group_kind_versions: None, - })); + }); spec.operations[original_list_operation_index] = list_operation; spec.operations.push(watch_operation); diff --git a/k8s-openapi-codegen/src/main.rs b/k8s-openapi-codegen/src/main.rs index a2ea7b3423..f6b28ce125 100644 --- a/k8s-openapi-codegen/src/main.rs +++ b/k8s-openapi-codegen/src/main.rs @@ -1391,20 +1391,13 @@ fn write_operation( _ => return Err(format!("unrecognized status code {}", status_code)), }; - let schema = schema.as_ref(); + let is_delete_ok_status = match &schema.kind { + swagger20::SchemaKind::Ref(ref_path) if + &**ref_path == "io.k8s.apimachinery.pkg.apis.meta.v1.Status" && + operation.method == swagger20::Method::Delete && + status_code == reqwest::StatusCode::OK => true, - let is_delete_ok_status = if let Some(schema) = schema { - match &schema.kind { - swagger20::SchemaKind::Ref(ref_path) if - &**ref_path == "io.k8s.apimachinery.pkg.apis.meta.v1.Status" && - operation.method == swagger20::Method::Delete && - status_code == reqwest::StatusCode::OK => true, - - _ => false, - } - } - else { - false + _ => false, }; Ok((http_status_code, variant_name, schema, is_delete_ok_status)) @@ -1687,53 +1680,41 @@ fn write_operation( writeln!(file, "pub enum {} {{", operation_result_name)?; for &(_, variant_name, schema, is_delete_ok_status) in &operation_responses { - if let Some(schema) = schema { - if is_delete_ok_status { - // DELETE operations that return metav1.Status for HTTP 200 can also return the object itself instead. - // - // Ref https://github.com/kubernetes/kubernetes/issues/59501 - writeln!(file, " {}Status({}),", variant_name, get_rust_type(&schema.kind, replace_namespaces, mod_root)?)?; - writeln!(file, " {}Value({}),", variant_name, get_fully_qualified_type_name( - type_name_and_ref_path_and_parent_mod_rs.as_ref() - .map(|(_, type_ref_path, _)| type_ref_path) - .ok_or_else(|| "DELETE-Ok-Status that isn't associated with a type")?, - &replace_namespaces, - mod_root)?)?; - } - else { - match &schema.kind { - crate::swagger20::SchemaKind::Ref(crate::swagger20::RefPath(ref_path)) if ref_path == "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" => - writeln!( - file, - " {}({}<{}>),", - variant_name, - get_rust_type(&schema.kind, replace_namespaces, mod_root)?, - type_name_and_ref_path_and_parent_mod_rs.as_ref() - .map(|(type_name, _, _)| type_name) - .ok_or_else(|| "WatchEvent operation that isn't associated with a type")?)?, - - _ => writeln!(file, " {}({}),", variant_name, get_rust_type(&schema.kind, replace_namespaces, mod_root)?)?, - } - } + if is_delete_ok_status { + // DELETE operations that return metav1.Status for HTTP 200 can also return the object itself instead. + // + // Ref https://github.com/kubernetes/kubernetes/issues/59501 + writeln!(file, " {}Status({}),", variant_name, get_rust_type(&schema.kind, replace_namespaces, mod_root)?)?; + writeln!(file, " {}Value({}),", variant_name, get_fully_qualified_type_name( + type_name_and_ref_path_and_parent_mod_rs.as_ref() + .map(|(_, type_ref_path, _)| type_ref_path) + .ok_or_else(|| "DELETE-Ok-Status that isn't associated with a type")?, + &replace_namespaces, + mod_root)?)?; } else { - writeln!(file, " {},", variant_name)?; + match &schema.kind { + crate::swagger20::SchemaKind::Ref(crate::swagger20::RefPath(ref_path)) if ref_path == "io.k8s.apimachinery.pkg.apis.meta.v1.WatchEvent" => + writeln!( + file, + " {}({}<{}>),", + variant_name, + get_rust_type(&schema.kind, replace_namespaces, mod_root)?, + type_name_and_ref_path_and_parent_mod_rs.as_ref() + .map(|(type_name, _, _)| type_name) + .ok_or_else(|| "WatchEvent operation that isn't associated with a type")?)?, + + _ => writeln!(file, " {}({}),", variant_name, get_rust_type(&schema.kind, replace_namespaces, mod_root)?)?, + } } } - writeln!(file, " Other,")?; + + writeln!(file, " Other(Result, serde_json::Error>),")?; writeln!(file, "}}")?; writeln!(file)?; writeln!(file, "impl crate::Response for {} {{", operation_result_name)?; - - let uses_buf = operation_responses.iter().any(|&(_, _, schema, _)| schema.is_some()); - - if uses_buf { - writeln!(file, " fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> {{")?; - } - else { - writeln!(file, " fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> {{")?; - } + writeln!(file, " fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> {{")?; let is_watch = match operation.kubernetes_action { Some(swagger20::KubernetesAction::Watch) | Some(swagger20::KubernetesAction::WatchList) => true, @@ -1742,80 +1723,87 @@ fn write_operation( writeln!(file, " match status_code {{")?; for &(http_status_code, variant_name, schema, is_delete_ok_status) in &operation_responses { - write!(file, " http::StatusCode::{} => ", http_status_code)?; - if let Some(schema) = schema { - writeln!(file, "{{")?; - - match &schema.kind { - swagger20::SchemaKind::Ty(swagger20::Type::String { .. }) => { - writeln!(file, " if buf.is_empty() {{")?; - writeln!(file, " return Err(crate::ResponseError::NeedMoreData);")?; - writeln!(file, " }}")?; - writeln!(file)?; - writeln!(file, " let (result, len) = match std::str::from_utf8(buf) {{")?; - writeln!(file, " Ok(s) => (s, buf.len()),")?; - writeln!(file, " Err(err) => match (err.valid_up_to(), err.error_len()) {{")?; - writeln!(file, " (0, Some(_)) => return Err(crate::ResponseError::Utf8(err)),")?; - writeln!(file, " (0, None) => return Err(crate::ResponseError::NeedMoreData),")?; - writeln!(file, " (valid_up_to, _) => (")?; - writeln!(file, " unsafe {{ std::str::from_utf8_unchecked(buf.get_unchecked(..valid_up_to)) }},")?; - writeln!(file, " valid_up_to,")?; - writeln!(file, " ),")?; - writeln!(file, " }},")?; - writeln!(file, " }};")?; - writeln!(file, " Ok(({}::{}(result.to_string()), len))", operation_result_name, variant_name)?; - }, - - swagger20::SchemaKind::Ref(_) => if is_watch { - writeln!(file, " let mut deserializer = serde_json::Deserializer::from_slice(buf).into_iter();")?; - writeln!(file, " let (result, byte_offset) = match deserializer.next() {{")?; - writeln!(file, " Some(Ok(value)) => (value, deserializer.byte_offset()),")?; - writeln!(file, " Some(Err(ref err)) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; - writeln!(file, " Some(Err(err)) => return Err(crate::ResponseError::Json(err)),")?; - writeln!(file, " None => return Err(crate::ResponseError::NeedMoreData),")?; - writeln!(file, " }};")?; - writeln!(file, " Ok(({}::{}(result), byte_offset))", operation_result_name, variant_name)?; - } - else if is_delete_ok_status { - writeln!(file, " let result: serde_json::Map = match serde_json::from_slice(buf) {{")?; - writeln!(file, " Ok(value) => value,")?; - writeln!(file, " Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; - writeln!(file, " Err(err) => return Err(crate::ResponseError::Json(err)),")?; - writeln!(file, " }};")?; - writeln!(file, r#" let is_status = match result.get("kind") {{"#)?; - writeln!(file, r#" Some(serde_json::Value::String(s)) if s == "Status" => true,"#)?; - writeln!(file, " _ => false,")?; - writeln!(file, " }};")?; - writeln!(file, " if is_status {{")?; - writeln!(file, " let result = serde::Deserialize::deserialize(serde_json::Value::Object(result));")?; - writeln!(file, " let result = result.map_err(crate::ResponseError::Json)?;")?; - writeln!(file, " Ok(({}::{}Status(result), buf.len()))", operation_result_name, variant_name)?; - writeln!(file, " }}")?; - writeln!(file, " else {{")?; - writeln!(file, " let result = serde::Deserialize::deserialize(serde_json::Value::Object(result));")?; - writeln!(file, " let result = result.map_err(crate::ResponseError::Json)?;")?; - writeln!(file, " Ok(({}::{}Value(result), buf.len()))", operation_result_name, variant_name)?; - writeln!(file, " }}")?; - } - else { - writeln!(file, " let result = match serde_json::from_slice(buf) {{")?; - writeln!(file, " Ok(value) => value,")?; - writeln!(file, " Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; - writeln!(file, " Err(err) => return Err(crate::ResponseError::Json(err)),")?; - writeln!(file, " }};")?; - writeln!(file, " Ok(({}::{}(result), buf.len()))", operation_result_name, variant_name)?; - }, + writeln!(file, " http::StatusCode::{} => {{", http_status_code)?; + + match &schema.kind { + swagger20::SchemaKind::Ty(swagger20::Type::String { .. }) => { + writeln!(file, " if buf.is_empty() {{")?; + writeln!(file, " return Err(crate::ResponseError::NeedMoreData);")?; + writeln!(file, " }}")?; + writeln!(file)?; + writeln!(file, " let (result, len) = match std::str::from_utf8(buf) {{")?; + writeln!(file, " Ok(s) => (s, buf.len()),")?; + writeln!(file, " Err(err) => match (err.valid_up_to(), err.error_len()) {{")?; + writeln!(file, " (0, Some(_)) => return Err(crate::ResponseError::Utf8(err)),")?; + writeln!(file, " (0, None) => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " (valid_up_to, _) => (")?; + writeln!(file, " unsafe {{ std::str::from_utf8_unchecked(buf.get_unchecked(..valid_up_to)) }},")?; + writeln!(file, " valid_up_to,")?; + writeln!(file, " ),")?; + writeln!(file, " }},")?; + writeln!(file, " }};")?; + writeln!(file, " Ok(({}::{}(result.to_string()), len))", operation_result_name, variant_name)?; + }, - other => return Err(format!("operation {} has unrecognized type for response of variant {}: {:?}", operation.id, variant_name, other).into()), + swagger20::SchemaKind::Ref(_) => if is_watch { + writeln!(file, " let mut deserializer = serde_json::Deserializer::from_slice(buf).into_iter();")?; + writeln!(file, " let (result, byte_offset) = match deserializer.next() {{")?; + writeln!(file, " Some(Ok(value)) => (value, deserializer.byte_offset()),")?; + writeln!(file, " Some(Err(ref err)) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " Some(Err(err)) => return Err(crate::ResponseError::Json(err)),")?; + writeln!(file, " None => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " }};")?; + writeln!(file, " Ok(({}::{}(result), byte_offset))", operation_result_name, variant_name)?; } + else if is_delete_ok_status { + writeln!(file, " let result: serde_json::Map = match serde_json::from_slice(buf) {{")?; + writeln!(file, " Ok(value) => value,")?; + writeln!(file, " Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " Err(err) => return Err(crate::ResponseError::Json(err)),")?; + writeln!(file, " }};")?; + writeln!(file, r#" let is_status = match result.get("kind") {{"#)?; + writeln!(file, r#" Some(serde_json::Value::String(s)) if s == "Status" => true,"#)?; + writeln!(file, " _ => false,")?; + writeln!(file, " }};")?; + writeln!(file, " if is_status {{")?; + writeln!(file, " let result = serde::Deserialize::deserialize(serde_json::Value::Object(result));")?; + writeln!(file, " let result = result.map_err(crate::ResponseError::Json)?;")?; + writeln!(file, " Ok(({}::{}Status(result), buf.len()))", operation_result_name, variant_name)?; + writeln!(file, " }}")?; + writeln!(file, " else {{")?; + writeln!(file, " let result = serde::Deserialize::deserialize(serde_json::Value::Object(result));")?; + writeln!(file, " let result = result.map_err(crate::ResponseError::Json)?;")?; + writeln!(file, " Ok(({}::{}Value(result), buf.len()))", operation_result_name, variant_name)?; + writeln!(file, " }}")?; + } + else { + writeln!(file, " let result = match serde_json::from_slice(buf) {{")?; + writeln!(file, " Ok(value) => value,")?; + writeln!(file, " Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " Err(err) => return Err(crate::ResponseError::Json(err)),")?; + writeln!(file, " }};")?; + writeln!(file, " Ok(({}::{}(result), buf.len()))", operation_result_name, variant_name)?; + }, - writeln!(file, " }},")?; - } - else { - writeln!(file, "Ok(({}::{}, 0)),", operation_result_name, variant_name)?; + other => return Err(format!("operation {} has unrecognized type for response of variant {}: {:?}", operation.id, variant_name, other).into()), } + + writeln!(file, " }},")?; } - writeln!(file, " _ => Ok(({}::Other, 0)),", operation_result_name)?; + writeln!(file, " _ => {{")?; + writeln!(file, " let (result, read) =")?; + writeln!(file, " if buf.is_empty() {{")?; + writeln!(file, " (Ok(None), 0)")?; + writeln!(file, " }}")?; + writeln!(file, " else {{")?; + writeln!(file, " match serde_json::from_slice(buf) {{")?; + writeln!(file, " Ok(value) => (Ok(Some(value)), buf.len()),")?; + writeln!(file, " Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData),")?; + writeln!(file, " Err(err) => (Err(err), 0),")?; + writeln!(file, " }}")?; + writeln!(file, " }};")?; + writeln!(file, " Ok(({}::Other(result), read))", operation_result_name)?; + writeln!(file, " }},")?; writeln!(file, " }}")?; writeln!(file, " }}")?; writeln!(file, "}}")?; diff --git a/k8s-openapi-codegen/src/swagger20/mod.rs b/k8s-openapi-codegen/src/swagger20/mod.rs index 4ba93a4fa8..100c31aeb7 100644 --- a/k8s-openapi-codegen/src/swagger20/mod.rs +++ b/k8s-openapi-codegen/src/swagger20/mod.rs @@ -85,10 +85,15 @@ impl<'de> serde::Deserialize<'de> for Spec { ) -> Result where D: serde::Deserializer<'de> { let responses: Result<_, _> = value.responses.into_iter() - .map(|(status_code_str, response)| { - let status_code = status_code_str.parse().map_err(|_| - serde::de::Error::invalid_value(serde::de::Unexpected::Str(&status_code_str), &"string representation of an HTTP status code"))?; - Ok((status_code, response.schema)) + .filter_map(|(status_code_str, response)| { + let status_code = match status_code_str.parse() { + Ok(status_code) => status_code, + Err(_) => return Some(Err(serde::de::Error::invalid_value( + serde::de::Unexpected::Str(&status_code_str), + &"string representation of an HTTP status code"))), + }; + let schema = response.schema?; + Some(Ok((status_code, schema))) }) .collect(); diff --git a/k8s-openapi-codegen/src/swagger20/paths.rs b/k8s-openapi-codegen/src/swagger20/paths.rs index c115be0dc5..413eaf09d8 100644 --- a/k8s-openapi-codegen/src/swagger20/paths.rs +++ b/k8s-openapi-codegen/src/swagger20/paths.rs @@ -93,7 +93,7 @@ pub struct Operation { pub kubernetes_group_kind_version: Option, pub parameters: Vec>, pub path: Path, - pub responses: std::collections::BTreeMap>, + pub responses: std::collections::BTreeMap, pub tag: String, } diff --git a/k8s-openapi-tests/src/custom_resource_definition.rs b/k8s-openapi-tests/src/custom_resource_definition.rs index c96e53725b..a14fb7ead2 100644 --- a/k8s-openapi-tests/src/custom_resource_definition.rs +++ b/k8s-openapi-tests/src/custom_resource_definition.rs @@ -133,37 +133,35 @@ fn create() { }; loop { - enum Result { - Ok(apiextensions::CustomResourceDefinition), - Conflict, - Retry, - } - let (request, response_body) = apiextensions::CustomResourceDefinition::create_custom_resource_definition(&custom_resource_definition, Default::default()) .expect("couldn't create custom resource definition"); let response = client.execute(request).expect("couldn't create custom resource definition"); - let custom_resource_definition = + let success = crate::get_single_value(response, response_body, |response, status_code, _response_body| k8s_match!(response, { - k8s_if_1_8!(apiextensions::CreateCustomResourceDefinitionResponse::Other if status_code == http::StatusCode::CREATED => - match serde_json::from_slice(_response_body) { - Ok(custom_resource_definition) => Ok(crate::ValueResult::GotValue(Result::Ok(custom_resource_definition))), - Err(ref err) if err.is_eof() => Ok(crate::ValueResult::NeedMoreData), - Err(err) => Err(err.into()), - }), - k8s_if_ge_1_9!(apiextensions::CreateCustomResourceDefinitionResponse::Created(custom_resource_definition) => - Ok(crate::ValueResult::GotValue(Result::Ok(custom_resource_definition)))), - apiextensions::CreateCustomResourceDefinitionResponse::Other if status_code == http::StatusCode::CONFLICT => - Ok(crate::ValueResult::GotValue(Result::Conflict)), - apiextensions::CreateCustomResourceDefinitionResponse::Other if status_code == http::StatusCode::INTERNAL_SERVER_ERROR => - Ok(crate::ValueResult::GotValue(Result::Retry)), + k8s_if_1_8!(apiextensions::CreateCustomResourceDefinitionResponse::Other(value) if status_code == http::StatusCode::CREATED => match value? { + Some(custom_resource_definition) => { + let _: apiextensions::CustomResourceDefinition = serde::Deserialize::deserialize(custom_resource_definition)?; + Ok(crate::ValueResult::GotValue(true)) + }, + None => Ok(crate::ValueResult::NeedMoreData), + }), + + k8s_if_ge_1_9!(apiextensions::CreateCustomResourceDefinitionResponse::Created(_) => + Ok(crate::ValueResult::GotValue(true))), + + apiextensions::CreateCustomResourceDefinitionResponse::Other(_) if status_code == http::StatusCode::CONFLICT => + Ok(crate::ValueResult::GotValue(true)), + + apiextensions::CreateCustomResourceDefinitionResponse::Other(_) if status_code == http::StatusCode::INTERNAL_SERVER_ERROR => + Ok(crate::ValueResult::GotValue(false)), + other => Err(format!("{:?} {}", other, status_code).into()), })).expect("couldn't create custom resource definition"); - match custom_resource_definition { - Result::Ok(_) | Result::Conflict => break, - Result::Retry => (), + if success { + break; } } diff --git a/src/lib.rs b/src/lib.rs index aedf8aada9..3c4752a77a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -105,6 +105,19 @@ //! helps ensure that the response body is parsed as the *correct* type for the operation, `ListNamespacedPodResponse` in this case, and not some other type. //! However, you can instead use your own byte buffer instead of the `ResponseBody` value and call `ListNamespacedPodResponse::try_from_parts` yourself. //! +//! 1. The response types are enums with variants corresponding to HTTP status codes. For example, the `ListNamespacedPodResponse::Ok` variant corresponds to the +//! HTTP 200 response of the list-namespaced-pod API. +//! +//! Each response enum also has an `Other` variant, that is yielded when the response status code does not match any of the other variants. +//! This variant has a `Result, `[`serde_json::Error`]`>` value. +//! +//! If the response body is empty, this value will be `Ok(None)`. +//! +//! If the response body is not empty, this value will be an `Ok(Some(value))` or Err(err) from attempting to parse that body as a `serde_json::Value`. +//! If you expect the response body to be a specific JSON type such as [`apimachinery::pkg::apis::meta::v1::Status`], you can use the `serde_json::Value` +//! as a [`serde::Deserializer`] like `let status = ::deserialize(value)?;`. On the other hand, if you expect the response body to not be +//! a JSON value, then ignore the `Err(err)` and parse the raw bytes of the response into the appropriate type. +//! //! Also see the `get_single_value` and `get_multiple_values` functions in the `k8s-openapi-tests/` directory in the repository for an example of how to use //! a synchronous client with this style of API. //! diff --git a/src/v1_10/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_10/api/admissionregistration/v1alpha1/initializer_configuration.rs index 8aa89661fb..3a1f9c4e88 100644 --- a/src/v1_10/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_10/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteInitializerConfigurationOptional<'a> { pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { Ok((DeleteInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_10::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_10/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 3c8efe9335..5dd8381f02 100644 --- a/src/v1_10/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_10/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteMutatingWebhookConfigurationOptional<'a> { pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { Ok((DeleteMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_10::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_10/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 0df592a1ee..a3b939bdf9 100644 --- a/src/v1_10/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_10/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteValidatingWebhookConfigurationOptional<'a> { pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { Ok((DeleteValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_10::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1/controller_revision.rs b/src/v1_10/api/apps/v1/controller_revision.rs index 81ca0e2fc0..eb05fc7410 100644 --- a/src/v1_10/api/apps/v1/controller_revision.rs +++ b/src/v1_10/api/apps/v1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevision), Created(crate::v1_10::api::apps::v1::ControllerRevision), Accepted(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1::ControllerRevision), Created(crate::v1_10::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1/daemon_set.rs b/src/v1_10/api/apps/v1/daemon_set.rs index 752737fed4..4c948c7e6e 100644 --- a/src/v1_10/api/apps/v1/daemon_set.rs +++ b/src/v1_10/api/apps/v1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), Created(crate::v1_10::api::apps::v1::DaemonSet), Accepted(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), Created(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1::DaemonSet), Created(crate::v1_10::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1/deployment.rs b/src/v1_10/api/apps/v1/deployment.rs index 4f8f9b8ffa..1dce13409c 100644 --- a/src/v1_10/api/apps/v1/deployment.rs +++ b/src/v1_10/api/apps/v1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1::Deployment), Created(crate::v1_10::api::apps::v1::Deployment), Accepted(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1::Deployment), Created(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1::Deployment), Created(crate::v1_10::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1/replica_set.rs b/src/v1_10/api/apps/v1/replica_set.rs index a483005ed4..18fa2197d8 100644 --- a/src/v1_10/api/apps/v1/replica_set.rs +++ b/src/v1_10/api/apps/v1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), Created(crate::v1_10::api::apps::v1::ReplicaSet), Accepted(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), Created(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1::ReplicaSet), Created(crate::v1_10::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1/stateful_set.rs b/src/v1_10/api/apps/v1/stateful_set.rs index 3533f6349e..e7dc156dad 100644 --- a/src/v1_10/api/apps/v1/stateful_set.rs +++ b/src/v1_10/api/apps/v1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), Created(crate::v1_10::api::apps::v1::StatefulSet), Accepted(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), Created(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1::StatefulSet), Created(crate::v1_10::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta1/controller_revision.rs b/src/v1_10/api/apps/v1beta1/controller_revision.rs index 015c7b8421..9e57ebffb2 100644 --- a/src/v1_10/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_10/api/apps/v1beta1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevision), Created(crate::v1_10::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta1::ControllerRevision), Created(crate::v1_10::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta1/deployment.rs b/src/v1_10/api/apps/v1beta1/deployment.rs index 1fecdf54b0..d41f84426d 100644 --- a/src/v1_10/api/apps/v1beta1/deployment.rs +++ b/src/v1_10/api/apps/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), Created(crate::v1_10::api::apps::v1beta1::Deployment), Accepted(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), Created(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::Deployment), Created(crate::v1_10::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta1/deployment_rollback.rs b/src/v1_10/api/apps/v1beta1/deployment_rollback.rs index 2a102c4744..8007a5ce6d 100644 --- a/src/v1_10/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_10/api/apps/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta1/scale.rs b/src/v1_10/api/apps/v1beta1/scale.rs index e9dbbd7a49..39f56fd599 100644 --- a/src/v1_10/api/apps/v1beta1/scale.rs +++ b/src/v1_10/api/apps/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -228,8 +250,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -243,8 +264,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -304,8 +337,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -319,8 +351,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -384,8 +428,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), Created(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -407,8 +450,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -472,8 +527,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta1::Scale), Created(crate::v1_10::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -495,8 +549,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta1/stateful_set.rs b/src/v1_10/api/apps/v1beta1/stateful_set.rs index 27bed4c3ce..3c7b91ee9d 100644 --- a/src/v1_10/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_10/api/apps/v1beta1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), Created(crate::v1_10::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), Created(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta1::StatefulSet), Created(crate::v1_10::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/controller_revision.rs b/src/v1_10/api/apps/v1beta2/controller_revision.rs index 6627bb3424..5c6ee0f011 100644 --- a/src/v1_10/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_10/api/apps/v1beta2/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevision), Created(crate::v1_10::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_10::api::apps::v1beta2::ControllerRevision), Created(crate::v1_10::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/daemon_set.rs b/src/v1_10/api/apps/v1beta2/daemon_set.rs index fe5d147472..17aebe3bf3 100644 --- a/src/v1_10/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_10/api/apps/v1beta2/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), Created(crate::v1_10::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), Created(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::DaemonSet), Created(crate::v1_10::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/deployment.rs b/src/v1_10/api/apps/v1beta2/deployment.rs index 7436599244..55db583709 100644 --- a/src/v1_10/api/apps/v1beta2/deployment.rs +++ b/src/v1_10/api/apps/v1beta2/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), Created(crate::v1_10::api::apps::v1beta2::Deployment), Accepted(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), Created(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::Deployment), Created(crate::v1_10::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/replica_set.rs b/src/v1_10/api/apps/v1beta2/replica_set.rs index 4118fe4ba9..a0c23de3c6 100644 --- a/src/v1_10/api/apps/v1beta2/replica_set.rs +++ b/src/v1_10/api/apps/v1beta2/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), Created(crate::v1_10::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), Created(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::ReplicaSet), Created(crate::v1_10::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/scale.rs b/src/v1_10/api/apps/v1beta2/scale.rs index ca1dc6570d..669b75917e 100644 --- a/src/v1_10/api/apps/v1beta2/scale.rs +++ b/src/v1_10/api/apps/v1beta2/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), Created(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), Created(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::apps::v1beta2::Scale), Created(crate::v1_10::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/apps/v1beta2/stateful_set.rs b/src/v1_10/api/apps/v1beta2/stateful_set.rs index 9247419322..29122b88ad 100644 --- a/src/v1_10/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_10/api/apps/v1beta2/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), Created(crate::v1_10::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), Created(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_10::api::apps::v1beta2::StatefulSet), Created(crate::v1_10::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authentication/v1/token_review.rs b/src/v1_10/api/authentication/v1/token_review.rs index 80b8d69e51..820bde0fdc 100644 --- a/src/v1_10/api/authentication/v1/token_review.rs +++ b/src/v1_10/api/authentication/v1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_10::api::authentication::v1::TokenReview), Created(crate::v1_10::api::authentication::v1::TokenReview), Accepted(crate::v1_10::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authentication/v1beta1/token_review.rs b/src/v1_10/api/authentication/v1beta1/token_review.rs index d8e9a3aadc..81636c0d3e 100644 --- a/src/v1_10/api/authentication/v1beta1/token_review.rs +++ b/src/v1_10/api/authentication/v1beta1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_10::api::authentication::v1beta1::TokenReview), Created(crate::v1_10::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_10::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1/local_subject_access_review.rs b/src/v1_10/api/authorization/v1/local_subject_access_review.rs index 7e2ee6407b..58f729d974 100644 --- a/src/v1_10/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_10/api/authorization/v1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_10::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1/self_subject_access_review.rs b/src/v1_10/api/authorization/v1/self_subject_access_review.rs index 569a64cfbb..c23452318f 100644 --- a/src/v1_10/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_10/api/authorization/v1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_10::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1/self_subject_rules_review.rs b/src/v1_10/api/authorization/v1/self_subject_rules_review.rs index 7961d68814..cc79cb8b85 100644 --- a/src/v1_10/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_10/api/authorization/v1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_10::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_10::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_10::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1/subject_access_review.rs b/src/v1_10/api/authorization/v1/subject_access_review.rs index 48c5c9a655..f13d5370db 100644 --- a/src/v1_10/api/authorization/v1/subject_access_review.rs +++ b/src/v1_10/api/authorization/v1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1::SubjectAccessReview), Created(crate::v1_10::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_10/api/authorization/v1beta1/local_subject_access_review.rs index 01679e0cea..9a48fee4e1 100644 --- a/src/v1_10/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_10/api/authorization/v1beta1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_10::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_10/api/authorization/v1beta1/self_subject_access_review.rs index 7a1d8aa4ac..935c512d03 100644 --- a/src/v1_10/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_10/api/authorization/v1beta1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_10::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_10/api/authorization/v1beta1/self_subject_rules_review.rs index 47bf433910..392b449f7b 100644 --- a/src/v1_10/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_10/api/authorization/v1beta1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_10::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_10::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_10::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/authorization/v1beta1/subject_access_review.rs b/src/v1_10/api/authorization/v1beta1/subject_access_review.rs index d6fa882933..a0517bbbad 100644 --- a/src/v1_10/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_10/api/authorization/v1beta1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_10::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_10::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_10::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_10/api/autoscaling/v1/horizontal_pod_autoscaler.rs index c5af9d8d54..551c5a6689 100644 --- a/src/v1_10/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_10/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/autoscaling/v1/scale.rs b/src/v1_10/api/autoscaling/v1/scale.rs index 9655cda8a2..af7c6d19f4 100644 --- a/src/v1_10/api/autoscaling/v1/scale.rs +++ b/src/v1_10/api/autoscaling/v1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -310,8 +343,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -325,8 +357,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -386,8 +430,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -401,8 +444,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -462,8 +517,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -477,8 +531,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -538,8 +604,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -553,8 +618,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -614,8 +691,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -629,8 +705,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -694,8 +782,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), Created(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -717,8 +804,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -782,8 +881,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), Created(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -805,8 +903,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -870,8 +980,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), Created(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -893,8 +1002,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -958,8 +1079,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_10::api::autoscaling::v1::Scale), Created(crate::v1_10::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -981,8 +1101,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_10/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index b3610a9b22..e51acc832a 100644 --- a/src/v1_10/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_10/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_10::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/batch/v1/job.rs b/src/v1_10/api/batch/v1/job.rs index 80bd4c9087..30a9a0503e 100644 --- a/src/v1_10/api/batch/v1/job.rs +++ b/src/v1_10/api/batch/v1/job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_10::api::batch::v1::Job), Created(crate::v1_10::api::batch::v1::Job), Accepted(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedJobOptional<'a> { pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedJobResponse { Ok((DeleteNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_10::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_10::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_10::api::batch::v1::Job), Created(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_10::api::batch::v1::Job), Created(crate::v1_10::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/batch/v1beta1/cron_job.rs b/src/v1_10/api/batch/v1beta1/cron_job.rs index bbe68ef5f9..da54300d97 100644 --- a/src/v1_10/api/batch/v1beta1/cron_job.rs +++ b/src/v1_10/api/batch/v1beta1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), Created(crate::v1_10::api::batch::v1beta1::CronJob), Accepted(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), Created(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v1beta1::CronJob), Created(crate::v1_10::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/batch/v2alpha1/cron_job.rs b/src/v1_10/api/batch/v2alpha1/cron_job.rs index b6ba9a7327..8441ad3a69 100644 --- a/src/v1_10/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_10/api/batch/v2alpha1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), Created(crate::v1_10::api::batch::v2alpha1::CronJob), Accepted(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), Created(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_10::api::batch::v2alpha1::CronJob), Created(crate::v1_10::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_10/api/certificates/v1beta1/certificate_signing_request.rs index 9ed0e4175f..0125c7c4ac 100644 --- a/src/v1_10/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_10/api/certificates/v1beta1/certificate_signing_request.rs @@ -64,8 +64,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteCertificateSigningRequestOptional<'a> { pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { Ok((DeleteCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -800,8 +888,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_10::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -823,8 +910,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -890,8 +989,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -907,8 +1005,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/binding.rs b/src/v1_10/api/core/v1/binding.rs index 4e40d717ac..b83fea6517 100644 --- a/src/v1_10/api/core/v1/binding.rs +++ b/src/v1_10/api/core/v1/binding.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_10::api::core::v1::Binding), Created(crate::v1_10::api::core::v1::Binding), Accepted(crate::v1_10::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_10::api::core::v1::Binding), Created(crate::v1_10::api::core::v1::Binding), Accepted(crate::v1_10::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -195,8 +205,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/component_status.rs b/src/v1_10/api/core/v1/component_status.rs index 55d3dc73a7..e52da1914e 100644 --- a/src/v1_10/api/core/v1/component_status.rs +++ b/src/v1_10/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_10::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_10::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/config_map.rs b/src/v1_10/api/core/v1/config_map.rs index 06e87a47d5..92f9ecd7d9 100644 --- a/src/v1_10/api/core/v1/config_map.rs +++ b/src/v1_10/api/core/v1/config_map.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_10::api::core::v1::ConfigMap), Created(crate::v1_10::api::core::v1::ConfigMap), Accepted(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedConfigMapOptional<'a> { pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { Ok((DeleteNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_10::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_10::api::core::v1::ConfigMap), Created(crate::v1_10::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/endpoints.rs b/src/v1_10/api/core/v1/endpoints.rs index 6938f65b5f..5a3e79ced6 100644 --- a/src/v1_10/api/core/v1/endpoints.rs +++ b/src/v1_10/api/core/v1/endpoints.rs @@ -78,8 +78,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_10::api::core::v1::Endpoints), Created(crate::v1_10::api::core::v1::Endpoints), Accepted(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -109,8 +108,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteNamespacedEndpointsOptional<'a> { pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { Ok((DeleteNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -520,8 +564,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_10::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -535,8 +578,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -599,8 +654,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -614,8 +668,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_10::api::core::v1::Endpoints), Created(crate::v1_10::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -790,8 +866,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -946,8 +1045,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -963,8 +1061,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/event.rs b/src/v1_10/api/core/v1/event.rs index 4496a2215a..74be162ffc 100644 --- a/src/v1_10/api/core/v1/event.rs +++ b/src/v1_10/api/core/v1/event.rs @@ -106,8 +106,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_10::api::core::v1::Event), Created(crate::v1_10::api::core::v1::Event), Accepted(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -137,8 +136,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -244,8 +255,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -272,8 +282,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -352,8 +374,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -380,8 +401,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -548,8 +592,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_10::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -563,8 +606,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -627,8 +682,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -642,8 +696,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -715,8 +781,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -730,8 +795,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -795,8 +872,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_10::api::core::v1::Event), Created(crate::v1_10::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -818,8 +894,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -902,8 +989,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -974,8 +1073,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -991,8 +1089,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/limit_range.rs b/src/v1_10/api/core/v1/limit_range.rs index cf30d781b0..2ad8f4bccb 100644 --- a/src/v1_10/api/core/v1/limit_range.rs +++ b/src/v1_10/api/core/v1/limit_range.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_10::api::core::v1::LimitRange), Created(crate::v1_10::api::core::v1::LimitRange), Accepted(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedLimitRangeOptional<'a> { pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { Ok((DeleteNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -415,8 +448,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -430,8 +462,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_10::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_10::api::core::v1::LimitRange), Created(crate::v1_10::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -863,8 +950,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/namespace.rs b/src/v1_10/api/core/v1/namespace.rs index b80d067370..a0735e62cc 100644 --- a/src/v1_10/api/core/v1/namespace.rs +++ b/src/v1_10/api/core/v1/namespace.rs @@ -65,8 +65,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_10::api::core::v1::Namespace), Created(crate::v1_10::api::core::v1::Namespace), Accepted(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteNamespaceOptional<'a> { pub enum DeleteNamespaceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteNamespaceResponse { Ok((DeleteNamespaceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -273,8 +295,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_10::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -288,8 +309,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -347,8 +380,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -362,8 +394,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -421,8 +465,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -436,8 +479,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -504,8 +559,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -519,8 +573,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -575,8 +641,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -590,8 +655,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -650,8 +727,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_10::api::core::v1::Namespace), Created(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -673,8 +749,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_10::api::core::v1::Namespace), Created(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -756,8 +843,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -816,8 +915,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_10::api::core::v1::Namespace), Created(crate::v1_10::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -839,8 +937,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -906,8 +1016,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -923,8 +1032,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/node.rs b/src/v1_10/api/core/v1/node.rs index 8fbd9586b7..3268251dd4 100644 --- a/src/v1_10/api/core/v1/node.rs +++ b/src/v1_10/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -900,8 +1010,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_10::api::core::v1::Node), Created(crate::v1_10::api::core::v1::Node), Accepted(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -931,8 +1040,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1033,8 +1154,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1061,8 +1181,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1136,8 +1268,7 @@ pub struct DeleteNodeOptional<'a> { pub enum DeleteNodeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1164,8 +1295,20 @@ impl crate::Response for DeleteNodeResponse { Ok((DeleteNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1238,8 +1381,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_10::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1253,8 +1395,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1312,8 +1466,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1327,8 +1480,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1386,8 +1551,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1401,8 +1565,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1469,8 +1645,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -1484,8 +1659,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -1540,8 +1727,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -1555,8 +1741,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -1615,8 +1813,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_10::api::core::v1::Node), Created(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -1638,8 +1835,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -1698,8 +1907,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_10::api::core::v1::Node), Created(crate::v1_10::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -1721,8 +1929,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -1788,8 +2008,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -1805,8 +2024,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/persistent_volume.rs b/src/v1_10/api/core/v1/persistent_volume.rs index a35b441901..f7ddd657f8 100644 --- a/src/v1_10/api/core/v1/persistent_volume.rs +++ b/src/v1_10/api/core/v1/persistent_volume.rs @@ -65,8 +65,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), Created(crate::v1_10::api::core::v1::PersistentVolume), Accepted(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -198,8 +209,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeletePersistentVolumeOptional<'a> { pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeletePersistentVolumeResponse { Ok((DeletePersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -551,8 +606,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -566,8 +620,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -649,8 +714,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -705,8 +782,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -720,8 +796,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -780,8 +868,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), Created(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -803,8 +890,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -863,8 +962,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolume), Created(crate::v1_10::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -886,8 +984,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -953,8 +1063,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -970,8 +1079,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/persistent_volume_claim.rs b/src/v1_10/api/core/v1/persistent_volume_claim.rs index c24d387855..d42614cf3f 100644 --- a/src/v1_10/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_10/api/core/v1/persistent_volume_claim.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), Created(crate::v1_10::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { Ok((DeleteNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), Created(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_10::api::core::v1::PersistentVolumeClaim), Created(crate::v1_10::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/pod.rs b/src/v1_10/api/core/v1/pod.rs index 02609bbe96..dc9676eda1 100644 --- a/src/v1_10/api/core/v1/pod.rs +++ b/src/v1_10/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1579,8 +1755,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_10::api::core::v1::Pod), Created(crate::v1_10::api::core::v1::Pod), Accepted(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1610,8 +1785,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1717,8 +1904,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1745,8 +1931,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1825,8 +2023,7 @@ pub struct DeleteNamespacedPodOptional<'a> { pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1853,8 +2050,20 @@ impl crate::Response for DeleteNamespacedPodResponse { Ok((DeleteNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1932,8 +2141,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_10::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1947,8 +2155,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2021,8 +2241,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2036,8 +2255,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2100,8 +2331,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2115,8 +2345,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2179,8 +2421,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2194,8 +2435,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2267,8 +2520,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2282,8 +2534,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2385,8 +2649,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -2410,8 +2673,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -2471,8 +2746,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -2486,8 +2760,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2551,8 +2837,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_10::api::core::v1::Pod), Created(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -2574,8 +2859,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2639,8 +2936,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_10::api::core::v1::Pod), Created(crate::v1_10::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -2662,8 +2958,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2734,8 +3042,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -2751,8 +3058,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2818,8 +3137,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -2835,8 +3153,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/pod_template.rs b/src/v1_10/api/core/v1/pod_template.rs index 5c5f51074e..d6569e2a2a 100644 --- a/src/v1_10/api/core/v1/pod_template.rs +++ b/src/v1_10/api/core/v1/pod_template.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_10::api::core::v1::PodTemplate), Created(crate::v1_10::api::core::v1::PodTemplate), Accepted(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedPodTemplateOptional<'a> { pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { Ok((DeleteNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_10::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_10::api::core::v1::PodTemplate), Created(crate::v1_10::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/replication_controller.rs b/src/v1_10/api/core/v1/replication_controller.rs index 2a920a8c79..7952ce0e4d 100644 --- a/src/v1_10/api/core/v1/replication_controller.rs +++ b/src/v1_10/api/core/v1/replication_controller.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), Created(crate::v1_10::api::core::v1::ReplicationController), Accepted(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicationControllerOptional<'a> { pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { Ok((DeleteNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_10::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), Created(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_10::api::core::v1::ReplicationController), Created(crate::v1_10::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/resource_quota.rs b/src/v1_10/api/core/v1/resource_quota.rs index d2faf6a918..f23f001a26 100644 --- a/src/v1_10/api/core/v1/resource_quota.rs +++ b/src/v1_10/api/core/v1/resource_quota.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), Created(crate::v1_10::api::core::v1::ResourceQuota), Accepted(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedResourceQuotaOptional<'a> { pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { Ok((DeleteNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_10::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), Created(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_10::api::core::v1::ResourceQuota), Created(crate::v1_10::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/secret.rs b/src/v1_10/api/core/v1/secret.rs index 8a014950ab..e5402773a3 100644 --- a/src/v1_10/api/core/v1/secret.rs +++ b/src/v1_10/api/core/v1/secret.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_10::api::core::v1::Secret), Created(crate::v1_10::api::core::v1::Secret), Accepted(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedSecretOptional<'a> { pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { Ok((DeleteNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_10::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_10::api::core::v1::Secret), Created(crate::v1_10::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/service.rs b/src/v1_10/api/core/v1/service.rs index 1d6087d421..2551db7440 100644 --- a/src/v1_10/api/core/v1/service.rs +++ b/src/v1_10/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -955,8 +1065,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_10::api::core::v1::Service), Created(crate::v1_10::api::core::v1::Service), Accepted(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -986,8 +1095,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1066,8 +1187,7 @@ pub struct DeleteNamespacedServiceOptional<'a> { pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1094,8 +1214,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { Ok((DeleteNamespacedServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1173,8 +1305,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_10::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1188,8 +1319,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1262,8 +1405,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1277,8 +1419,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1341,8 +1495,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1356,8 +1509,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1420,8 +1585,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1435,8 +1599,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1508,8 +1684,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -1523,8 +1698,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1584,8 +1771,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -1599,8 +1785,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1664,8 +1862,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_10::api::core::v1::Service), Created(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -1687,8 +1884,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1752,8 +1961,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_10::api::core::v1::Service), Created(crate::v1_10::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -1775,8 +1983,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1847,8 +2067,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -1864,8 +2083,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1931,8 +2162,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -1948,8 +2178,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/core/v1/service_account.rs b/src/v1_10/api/core/v1/service_account.rs index 68cda6874a..d7c4e1fb4d 100644 --- a/src/v1_10/api/core/v1/service_account.rs +++ b/src/v1_10/api/core/v1/service_account.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_10::api::core::v1::ServiceAccount), Created(crate::v1_10::api::core::v1::ServiceAccount), Accepted(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedServiceAccountOptional<'a> { pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { Ok((DeleteNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_10::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_10::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_10::api::core::v1::ServiceAccount), Created(crate::v1_10::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/events/v1beta1/event.rs b/src/v1_10/api/events/v1beta1/event.rs index 3c1a3e5c40..406acf68c7 100644 --- a/src/v1_10/api/events/v1beta1/event.rs +++ b/src/v1_10/api/events/v1beta1/event.rs @@ -105,8 +105,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_10::api::events::v1beta1::Event), Created(crate::v1_10::api::events::v1beta1::Event), Accepted(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -136,8 +135,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -243,8 +254,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -271,8 +281,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -351,8 +373,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -379,8 +400,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -453,8 +486,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_10::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -468,8 +500,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -547,8 +591,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_10::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -562,8 +605,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -794,8 +871,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_10::api::events::v1beta1::Event), Created(crate::v1_10::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -817,8 +893,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -884,8 +972,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -901,8 +988,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -973,8 +1072,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -990,8 +1088,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/daemon_set.rs b/src/v1_10/api/extensions/v1beta1/daemon_set.rs index 4247b38da7..8d76d26837 100644 --- a/src/v1_10/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_10/api/extensions/v1beta1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), Created(crate::v1_10::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), Created(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::DaemonSet), Created(crate::v1_10::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/deployment.rs b/src/v1_10/api/extensions/v1beta1/deployment.rs index 7a0fa79e6f..2e30abd267 100644 --- a/src/v1_10/api/extensions/v1beta1/deployment.rs +++ b/src/v1_10/api/extensions/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), Created(crate::v1_10::api::extensions::v1beta1::Deployment), Accepted(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_10::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_10::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), Created(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Deployment), Created(crate::v1_10::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_10/api/extensions/v1beta1/deployment_rollback.rs index e13d0c041b..2a3235662b 100644 --- a/src/v1_10/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_10/api/extensions/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_10::api::extensions::v1beta1::DeploymentRollback), Created(crate::v1_10::api::extensions::v1beta1::DeploymentRollback), Accepted(crate::v1_10::api::extensions::v1beta1::DeploymentRollback), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/ingress.rs b/src/v1_10/api/extensions/v1beta1/ingress.rs index 54a0b4eebe..847e610b0d 100644 --- a/src/v1_10/api/extensions/v1beta1/ingress.rs +++ b/src/v1_10/api/extensions/v1beta1/ingress.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), Created(crate::v1_10::api::extensions::v1beta1::Ingress), Accepted(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedIngressOptional<'a> { pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { Ok((DeleteNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_10::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_10::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), Created(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::Ingress), Created(crate::v1_10::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/network_policy.rs b/src/v1_10/api/extensions/v1beta1/network_policy.rs index d71a27e880..0ada5c3843 100644 --- a/src/v1_10/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_10/api/extensions/v1beta1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_10::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_10/api/extensions/v1beta1/pod_security_policy.rs index 7a718d4742..b9dc90ae24 100644 --- a/src/v1_10/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_10/api/extensions/v1beta1/pod_security_policy.rs @@ -62,8 +62,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_10::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/replica_set.rs b/src/v1_10/api/extensions/v1beta1/replica_set.rs index 6ad48132ac..5629a6b6c4 100644 --- a/src/v1_10/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_10/api/extensions/v1beta1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_10::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_10::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_10::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/extensions/v1beta1/scale.rs b/src/v1_10/api/extensions/v1beta1/scale.rs index 9299f09c5f..e126200dad 100644 --- a/src/v1_10/api/extensions/v1beta1/scale.rs +++ b/src/v1_10/api/extensions/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), Created(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), Created(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_10::api::extensions::v1beta1::Scale), Created(crate::v1_10::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/networking/v1/network_policy.rs b/src/v1_10/api/networking/v1/network_policy.rs index 208b430ff6..50888fb883 100644 --- a/src/v1_10/api/networking/v1/network_policy.rs +++ b/src/v1_10/api/networking/v1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicy), Created(crate::v1_10::api::networking::v1::NetworkPolicy), Accepted(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_10::api::networking::v1::NetworkPolicy), Created(crate::v1_10::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/policy/v1beta1/eviction.rs b/src/v1_10/api/policy/v1beta1/eviction.rs index b1da358d32..9a1809cb4f 100644 --- a/src/v1_10/api/policy/v1beta1/eviction.rs +++ b/src/v1_10/api/policy/v1beta1/eviction.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_10::api::policy::v1beta1::Eviction), Created(crate::v1_10::api::policy::v1beta1::Eviction), Accepted(crate::v1_10::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_10/api/policy/v1beta1/pod_disruption_budget.rs index 84d51fd90c..e771a7d8f1 100644 --- a/src/v1_10/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_10/api/policy/v1beta1/pod_disruption_budget.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -207,8 +218,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -235,8 +245,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { Ok((DeleteNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -526,8 +569,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -590,8 +645,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -605,8 +659,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -669,8 +735,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -684,8 +749,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -757,8 +834,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -772,8 +848,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -833,8 +921,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -848,8 +935,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -913,8 +1012,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -936,8 +1034,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1001,8 +1111,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_10::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1024,8 +1133,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1096,8 +1217,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1113,8 +1233,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1180,8 +1312,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1197,8 +1328,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/policy/v1beta1/pod_security_policy.rs b/src/v1_10/api/policy/v1beta1/pod_security_policy.rs index fe4ff3aaa6..c34ac910f7 100644 --- a/src/v1_10/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_10/api/policy/v1beta1/pod_security_policy.rs @@ -62,8 +62,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_10::api::policy::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_10::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1/cluster_role.rs b/src/v1_10/api/rbac/v1/cluster_role.rs index 7d3b27b1ba..30b2b08738 100644 --- a/src/v1_10/api/rbac/v1/cluster_role.rs +++ b/src/v1_10/api/rbac/v1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRole), Created(crate::v1_10::api::rbac::v1::ClusterRole), Accepted(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRole), Created(crate::v1_10::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1/cluster_role_binding.rs b/src/v1_10/api/rbac/v1/cluster_role_binding.rs index 5c1522bc18..3534ca76ae 100644 --- a/src/v1_10/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_10/api/rbac/v1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1/role.rs b/src/v1_10/api/rbac/v1/role.rs index 348f5f6a8f..975e8b2ef3 100644 --- a/src/v1_10/api/rbac/v1/role.rs +++ b/src/v1_10/api/rbac/v1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1::Role), Created(crate::v1_10::api::rbac::v1::Role), Accepted(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1::Role), Created(crate::v1_10::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1/role_binding.rs b/src/v1_10/api/rbac/v1/role_binding.rs index a51a291604..32d72c166b 100644 --- a/src/v1_10/api/rbac/v1/role_binding.rs +++ b/src/v1_10/api/rbac/v1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::RoleBinding), Created(crate::v1_10::api::rbac::v1::RoleBinding), Accepted(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1::RoleBinding), Created(crate::v1_10::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1alpha1/cluster_role.rs b/src/v1_10/api/rbac/v1alpha1/cluster_role.rs index 59f3c260d1..fa3d75cc41 100644 --- a/src/v1_10/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_10/api/rbac/v1alpha1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_10::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_10::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_10/api/rbac/v1alpha1/cluster_role_binding.rs index 237ad8144f..d894c0b5d2 100644 --- a/src/v1_10/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_10/api/rbac/v1alpha1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1alpha1/role.rs b/src/v1_10/api/rbac/v1alpha1/role.rs index c097323168..dfe239ccce 100644 --- a/src/v1_10/api/rbac/v1alpha1/role.rs +++ b/src/v1_10/api/rbac/v1alpha1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::Role), Created(crate::v1_10::api::rbac::v1alpha1::Role), Accepted(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1alpha1::Role), Created(crate::v1_10::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1alpha1/role_binding.rs b/src/v1_10/api/rbac/v1alpha1/role_binding.rs index c4fa40ffc2..361be42c7a 100644 --- a/src/v1_10/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_10/api/rbac/v1alpha1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_10::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_10::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1beta1/cluster_role.rs b/src/v1_10/api/rbac/v1beta1/cluster_role.rs index 3c991c161b..6204f558e1 100644 --- a/src/v1_10/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_10/api/rbac/v1beta1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRole), Created(crate::v1_10::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRole), Created(crate::v1_10::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_10/api/rbac/v1beta1/cluster_role_binding.rs index 9e56d65a26..f1ce98ba9c 100644 --- a/src/v1_10/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_10/api/rbac/v1beta1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_10::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1beta1/role.rs b/src/v1_10/api/rbac/v1beta1/role.rs index f0505c332f..37230437fa 100644 --- a/src/v1_10/api/rbac/v1beta1/role.rs +++ b/src/v1_10/api/rbac/v1beta1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::Role), Created(crate::v1_10::api::rbac::v1beta1::Role), Accepted(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_10::api::rbac::v1beta1::Role), Created(crate::v1_10::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/rbac/v1beta1/role_binding.rs b/src/v1_10/api/rbac/v1beta1/role_binding.rs index 3b40d1f4c3..30d9e13543 100644 --- a/src/v1_10/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_10/api/rbac/v1beta1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBinding), Created(crate::v1_10::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_10::api::rbac::v1beta1::RoleBinding), Created(crate::v1_10::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/scheduling/v1alpha1/priority_class.rs b/src/v1_10/api/scheduling/v1alpha1/priority_class.rs index 1fc9261bc5..ec55c9d1b9 100644 --- a/src/v1_10/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_10/api/scheduling/v1alpha1/priority_class.rs @@ -68,8 +68,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -99,8 +98,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -201,8 +212,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -229,8 +239,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -304,8 +326,7 @@ pub struct DeletePriorityClassOptional<'a> { pub enum DeletePriorityClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -332,8 +353,20 @@ impl crate::Response for DeletePriorityClassResponse { Ok((DeletePriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -406,8 +439,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_10::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -421,8 +453,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -480,8 +524,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -495,8 +538,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -563,8 +618,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -578,8 +632,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -638,8 +704,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_10::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -745,8 +821,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/settings/v1alpha1/pod_preset.rs b/src/v1_10/api/settings/v1alpha1/pod_preset.rs index d93736b331..1a9018fae5 100644 --- a/src/v1_10/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_10/api/settings/v1alpha1/pod_preset.rs @@ -65,8 +65,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPreset), Created(crate::v1_10::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -311,8 +333,7 @@ pub struct DeleteNamespacedPodPresetOptional<'a> { pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -339,8 +360,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { Ok((DeleteNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -507,8 +551,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -522,8 +565,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -586,8 +641,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -601,8 +655,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_10::api::settings::v1alpha1::PodPreset), Created(crate::v1_10::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -777,8 +853,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -933,8 +1032,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -950,8 +1048,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/storage/v1/storage_class.rs b/src/v1_10/api/storage/v1/storage_class.rs index 74166c9057..9b19c8cda7 100644 --- a/src/v1_10/api/storage/v1/storage_class.rs +++ b/src/v1_10/api/storage/v1/storage_class.rs @@ -79,8 +79,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_10::api::storage::v1::StorageClass), Created(crate::v1_10::api::storage::v1::StorageClass), Accepted(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -417,8 +450,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_10::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -432,8 +464,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -506,8 +549,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -574,8 +629,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -589,8 +643,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_10::api::storage::v1::StorageClass), Created(crate::v1_10::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -672,8 +737,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -739,8 +816,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -756,8 +832,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/storage/v1alpha1/volume_attachment.rs b/src/v1_10/api/storage/v1alpha1/volume_attachment.rs index 6d987a5db1..dcfeba556f 100644 --- a/src/v1_10/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_10/api/storage/v1alpha1/volume_attachment.rs @@ -67,8 +67,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -200,8 +211,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -228,8 +238,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -303,8 +325,7 @@ pub struct DeleteVolumeAttachmentOptional<'a> { pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -331,8 +352,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { Ok((DeleteVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -479,8 +523,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -494,8 +537,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -562,8 +617,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -577,8 +631,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -637,8 +703,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_10::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -660,8 +725,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -727,8 +804,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -744,8 +820,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/storage/v1beta1/storage_class.rs b/src/v1_10/api/storage/v1beta1/storage_class.rs index 50b8c6890d..7ffe8c4281 100644 --- a/src/v1_10/api/storage/v1beta1/storage_class.rs +++ b/src/v1_10/api/storage/v1beta1/storage_class.rs @@ -79,8 +79,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_10::api::storage::v1beta1::StorageClass), Created(crate::v1_10::api::storage::v1beta1::StorageClass), Accepted(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -417,8 +450,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_10::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -432,8 +464,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -506,8 +549,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -574,8 +629,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -589,8 +643,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_10::api::storage::v1beta1::StorageClass), Created(crate::v1_10::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -672,8 +737,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -739,8 +816,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -756,8 +832,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/api/storage/v1beta1/volume_attachment.rs b/src/v1_10/api/storage/v1beta1/volume_attachment.rs index cd7b70eb83..fd696d4f6a 100644 --- a/src/v1_10/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_10/api/storage/v1beta1/volume_attachment.rs @@ -67,8 +67,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_10::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -200,8 +211,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -228,8 +238,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -303,8 +325,7 @@ pub struct DeleteVolumeAttachmentOptional<'a> { pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -331,8 +352,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { Ok((DeleteVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1beta1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -479,8 +523,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -494,8 +537,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -562,8 +617,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -577,8 +631,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -637,8 +703,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_10::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_10::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -660,8 +725,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -727,8 +804,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -744,8 +820,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_10/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index 5243173c31..4cb4e44747 100644 --- a/src/v1_10/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_10/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -64,8 +64,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -197,8 +208,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCustomResourceDefinitionOptional<'a> { pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { Ok((DeleteCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_10::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -807,8 +895,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -824,8 +911,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 1823009ca0..0ececf4833 100644 --- a/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -64,8 +64,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -807,8 +895,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -824,8 +911,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 3cad2651ad..221c71e6a0 100644 --- a/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_10/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -64,8 +64,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_10::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_10::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -807,8 +895,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -824,8 +911,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_10/mod.rs b/src/v1_10/mod.rs index efd5829a90..1fa2da4a50 100644 --- a/src/v1_10/mod.rs +++ b/src/v1_10/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1APIResourcesResponse { }; Ok((GetApiregistrationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_10::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2138,8 +2688,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_10::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2153,8 +2702,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2184,15 +2745,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2215,15 +2787,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_11/api/admissionregistration/v1alpha1/initializer_configuration.rs index 68df036f89..99fcacc0ce 100644 --- a/src/v1_11/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_11/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteInitializerConfigurationOptional<'a> { pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { Ok((DeleteInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_11::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_11/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index a5751a6518..2014db1665 100644 --- a/src/v1_11/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_11/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteMutatingWebhookConfigurationOptional<'a> { pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { Ok((DeleteMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_11::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_11/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 84460e83f9..d8ebce0530 100644 --- a/src/v1_11/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_11/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteValidatingWebhookConfigurationOptional<'a> { pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { Ok((DeleteValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_11::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1/controller_revision.rs b/src/v1_11/api/apps/v1/controller_revision.rs index 3262bf4d59..380cff2883 100644 --- a/src/v1_11/api/apps/v1/controller_revision.rs +++ b/src/v1_11/api/apps/v1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevision), Created(crate::v1_11::api::apps::v1::ControllerRevision), Accepted(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1::ControllerRevision), Created(crate::v1_11::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1/daemon_set.rs b/src/v1_11/api/apps/v1/daemon_set.rs index 23f9165633..35be081cf3 100644 --- a/src/v1_11/api/apps/v1/daemon_set.rs +++ b/src/v1_11/api/apps/v1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), Created(crate::v1_11::api::apps::v1::DaemonSet), Accepted(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), Created(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1::DaemonSet), Created(crate::v1_11::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1/deployment.rs b/src/v1_11/api/apps/v1/deployment.rs index d7ef3bf974..72aa854ad6 100644 --- a/src/v1_11/api/apps/v1/deployment.rs +++ b/src/v1_11/api/apps/v1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1::Deployment), Created(crate::v1_11::api::apps::v1::Deployment), Accepted(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1::Deployment), Created(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1::Deployment), Created(crate::v1_11::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1/replica_set.rs b/src/v1_11/api/apps/v1/replica_set.rs index f5b053b344..96a2a2de6e 100644 --- a/src/v1_11/api/apps/v1/replica_set.rs +++ b/src/v1_11/api/apps/v1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), Created(crate::v1_11::api::apps::v1::ReplicaSet), Accepted(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), Created(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1::ReplicaSet), Created(crate::v1_11::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1/stateful_set.rs b/src/v1_11/api/apps/v1/stateful_set.rs index 0bff23c00e..cf1d1e0ef2 100644 --- a/src/v1_11/api/apps/v1/stateful_set.rs +++ b/src/v1_11/api/apps/v1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), Created(crate::v1_11::api::apps::v1::StatefulSet), Accepted(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), Created(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1::StatefulSet), Created(crate::v1_11::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta1/controller_revision.rs b/src/v1_11/api/apps/v1beta1/controller_revision.rs index 39d88da676..ffb3b53a12 100644 --- a/src/v1_11/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_11/api/apps/v1beta1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevision), Created(crate::v1_11::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta1::ControllerRevision), Created(crate::v1_11::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta1/deployment.rs b/src/v1_11/api/apps/v1beta1/deployment.rs index 7e1d978806..523340507e 100644 --- a/src/v1_11/api/apps/v1beta1/deployment.rs +++ b/src/v1_11/api/apps/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), Created(crate::v1_11::api::apps::v1beta1::Deployment), Accepted(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), Created(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::Deployment), Created(crate::v1_11::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta1/deployment_rollback.rs b/src/v1_11/api/apps/v1beta1/deployment_rollback.rs index 2bf5bda2ac..4da12dd999 100644 --- a/src/v1_11/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_11/api/apps/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta1/scale.rs b/src/v1_11/api/apps/v1beta1/scale.rs index 09c40aadf5..a644d4f97f 100644 --- a/src/v1_11/api/apps/v1beta1/scale.rs +++ b/src/v1_11/api/apps/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -228,8 +250,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -243,8 +264,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -304,8 +337,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -319,8 +351,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -384,8 +428,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), Created(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -407,8 +450,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -472,8 +527,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta1::Scale), Created(crate::v1_11::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -495,8 +549,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta1/stateful_set.rs b/src/v1_11/api/apps/v1beta1/stateful_set.rs index 964f766665..b737edf515 100644 --- a/src/v1_11/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_11/api/apps/v1beta1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), Created(crate::v1_11::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), Created(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta1::StatefulSet), Created(crate::v1_11::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/controller_revision.rs b/src/v1_11/api/apps/v1beta2/controller_revision.rs index fedc1cce1e..d73b41d4aa 100644 --- a/src/v1_11/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_11/api/apps/v1beta2/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevision), Created(crate::v1_11::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_11::api::apps::v1beta2::ControllerRevision), Created(crate::v1_11::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/daemon_set.rs b/src/v1_11/api/apps/v1beta2/daemon_set.rs index f209e86228..9f0ceaad23 100644 --- a/src/v1_11/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_11/api/apps/v1beta2/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), Created(crate::v1_11::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), Created(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::DaemonSet), Created(crate::v1_11::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/deployment.rs b/src/v1_11/api/apps/v1beta2/deployment.rs index 62d6549bc0..aa05850d9d 100644 --- a/src/v1_11/api/apps/v1beta2/deployment.rs +++ b/src/v1_11/api/apps/v1beta2/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), Created(crate::v1_11::api::apps::v1beta2::Deployment), Accepted(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), Created(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::Deployment), Created(crate::v1_11::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/replica_set.rs b/src/v1_11/api/apps/v1beta2/replica_set.rs index 95c754c386..ebc1f2d8c9 100644 --- a/src/v1_11/api/apps/v1beta2/replica_set.rs +++ b/src/v1_11/api/apps/v1beta2/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), Created(crate::v1_11::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), Created(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::ReplicaSet), Created(crate::v1_11::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/scale.rs b/src/v1_11/api/apps/v1beta2/scale.rs index ae288baa8c..f6d70fa0d0 100644 --- a/src/v1_11/api/apps/v1beta2/scale.rs +++ b/src/v1_11/api/apps/v1beta2/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), Created(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), Created(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::apps::v1beta2::Scale), Created(crate::v1_11::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/apps/v1beta2/stateful_set.rs b/src/v1_11/api/apps/v1beta2/stateful_set.rs index 0b91a18186..ac0ad4c35d 100644 --- a/src/v1_11/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_11/api/apps/v1beta2/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), Created(crate::v1_11::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), Created(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_11::api::apps::v1beta2::StatefulSet), Created(crate::v1_11::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authentication/v1/token_review.rs b/src/v1_11/api/authentication/v1/token_review.rs index 730807b3b4..c7cc316e17 100644 --- a/src/v1_11/api/authentication/v1/token_review.rs +++ b/src/v1_11/api/authentication/v1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_11::api::authentication::v1::TokenReview), Created(crate::v1_11::api::authentication::v1::TokenReview), Accepted(crate::v1_11::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authentication/v1beta1/token_review.rs b/src/v1_11/api/authentication/v1beta1/token_review.rs index 4439a8c08b..1dc4fc7320 100644 --- a/src/v1_11/api/authentication/v1beta1/token_review.rs +++ b/src/v1_11/api/authentication/v1beta1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_11::api::authentication::v1beta1::TokenReview), Created(crate::v1_11::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_11::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1/local_subject_access_review.rs b/src/v1_11/api/authorization/v1/local_subject_access_review.rs index 5345d33229..c67b9d82db 100644 --- a/src/v1_11/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_11/api/authorization/v1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_11::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1/self_subject_access_review.rs b/src/v1_11/api/authorization/v1/self_subject_access_review.rs index 169825bc21..8dae9377c4 100644 --- a/src/v1_11/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_11/api/authorization/v1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_11::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1/self_subject_rules_review.rs b/src/v1_11/api/authorization/v1/self_subject_rules_review.rs index e93171b9fb..43a42cc774 100644 --- a/src/v1_11/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_11/api/authorization/v1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_11::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_11::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_11::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1/subject_access_review.rs b/src/v1_11/api/authorization/v1/subject_access_review.rs index 000ea01e5d..e7b260803f 100644 --- a/src/v1_11/api/authorization/v1/subject_access_review.rs +++ b/src/v1_11/api/authorization/v1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1::SubjectAccessReview), Created(crate::v1_11::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_11/api/authorization/v1beta1/local_subject_access_review.rs index 94f03ca831..ddf3316b62 100644 --- a/src/v1_11/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_11/api/authorization/v1beta1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_11::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_11/api/authorization/v1beta1/self_subject_access_review.rs index e4bf248db2..729ef272dd 100644 --- a/src/v1_11/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_11/api/authorization/v1beta1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_11::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_11/api/authorization/v1beta1/self_subject_rules_review.rs index b5935ec05e..2a5efbb12c 100644 --- a/src/v1_11/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_11/api/authorization/v1beta1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_11::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_11::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_11::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/authorization/v1beta1/subject_access_review.rs b/src/v1_11/api/authorization/v1beta1/subject_access_review.rs index fd162f0ff2..0c2e402894 100644 --- a/src/v1_11/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_11/api/authorization/v1beta1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_11::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_11::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_11::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_11/api/autoscaling/v1/horizontal_pod_autoscaler.rs index e8aca3b10a..7dc47f05f9 100644 --- a/src/v1_11/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_11/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/autoscaling/v1/scale.rs b/src/v1_11/api/autoscaling/v1/scale.rs index b6aecaa9fb..86b89f0b75 100644 --- a/src/v1_11/api/autoscaling/v1/scale.rs +++ b/src/v1_11/api/autoscaling/v1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -310,8 +343,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -325,8 +357,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -386,8 +430,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -401,8 +444,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -462,8 +517,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -477,8 +531,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -538,8 +604,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -553,8 +618,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -614,8 +691,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -629,8 +705,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -694,8 +782,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), Created(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -717,8 +804,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -782,8 +881,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), Created(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -805,8 +903,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -870,8 +980,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), Created(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -893,8 +1002,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -958,8 +1079,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_11::api::autoscaling::v1::Scale), Created(crate::v1_11::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -981,8 +1101,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_11/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index 2c8b115b03..e3508bfd2d 100644 --- a/src/v1_11/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_11/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_11::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/batch/v1/job.rs b/src/v1_11/api/batch/v1/job.rs index d82ea890a6..b496bcf0fe 100644 --- a/src/v1_11/api/batch/v1/job.rs +++ b/src/v1_11/api/batch/v1/job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_11::api::batch::v1::Job), Created(crate::v1_11::api::batch::v1::Job), Accepted(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedJobOptional<'a> { pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedJobResponse { Ok((DeleteNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_11::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_11::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_11::api::batch::v1::Job), Created(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_11::api::batch::v1::Job), Created(crate::v1_11::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/batch/v1beta1/cron_job.rs b/src/v1_11/api/batch/v1beta1/cron_job.rs index 601b249dc7..1397104b4b 100644 --- a/src/v1_11/api/batch/v1beta1/cron_job.rs +++ b/src/v1_11/api/batch/v1beta1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), Created(crate::v1_11::api::batch::v1beta1::CronJob), Accepted(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), Created(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v1beta1::CronJob), Created(crate::v1_11::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/batch/v2alpha1/cron_job.rs b/src/v1_11/api/batch/v2alpha1/cron_job.rs index bd96bfb2c4..766f364928 100644 --- a/src/v1_11/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_11/api/batch/v2alpha1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), Created(crate::v1_11::api::batch::v2alpha1::CronJob), Accepted(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), Created(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_11::api::batch::v2alpha1::CronJob), Created(crate::v1_11::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_11/api/certificates/v1beta1/certificate_signing_request.rs index 9142c2e435..ddea477dc3 100644 --- a/src/v1_11/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_11/api/certificates/v1beta1/certificate_signing_request.rs @@ -64,8 +64,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteCertificateSigningRequestOptional<'a> { pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { Ok((DeleteCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -550,8 +605,7 @@ pub struct PatchCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestStatusResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestStatusResponse { @@ -565,8 +619,20 @@ impl crate::Response for PatchCertificateSigningRequestStatusResponse { }; Ok((PatchCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -633,8 +699,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -648,8 +713,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -704,8 +781,7 @@ pub struct ReadCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestStatusResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestStatusResponse { @@ -719,8 +795,20 @@ impl crate::Response for ReadCertificateSigningRequestStatusResponse { }; Ok((ReadCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -779,8 +867,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -802,8 +889,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -862,8 +961,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -885,8 +983,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -945,8 +1055,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_11::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -968,8 +1077,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -1035,8 +1156,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -1052,8 +1172,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/binding.rs b/src/v1_11/api/core/v1/binding.rs index 61f51ceb2e..5bd5a61008 100644 --- a/src/v1_11/api/core/v1/binding.rs +++ b/src/v1_11/api/core/v1/binding.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_11::api::core::v1::Binding), Created(crate::v1_11::api::core::v1::Binding), Accepted(crate::v1_11::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_11::api::core::v1::Binding), Created(crate::v1_11::api::core::v1::Binding), Accepted(crate::v1_11::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -195,8 +205,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/component_status.rs b/src/v1_11/api/core/v1/component_status.rs index 32b0e879ad..d8dd6fa787 100644 --- a/src/v1_11/api/core/v1/component_status.rs +++ b/src/v1_11/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_11::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_11::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/config_map.rs b/src/v1_11/api/core/v1/config_map.rs index a839b6476a..d510df4c2f 100644 --- a/src/v1_11/api/core/v1/config_map.rs +++ b/src/v1_11/api/core/v1/config_map.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_11::api::core::v1::ConfigMap), Created(crate::v1_11::api::core::v1::ConfigMap), Accepted(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedConfigMapOptional<'a> { pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { Ok((DeleteNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_11::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_11::api::core::v1::ConfigMap), Created(crate::v1_11::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/endpoints.rs b/src/v1_11/api/core/v1/endpoints.rs index 364d0dbbd3..9761f2ae8f 100644 --- a/src/v1_11/api/core/v1/endpoints.rs +++ b/src/v1_11/api/core/v1/endpoints.rs @@ -78,8 +78,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_11::api::core::v1::Endpoints), Created(crate::v1_11::api::core::v1::Endpoints), Accepted(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -109,8 +108,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteNamespacedEndpointsOptional<'a> { pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { Ok((DeleteNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -520,8 +564,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_11::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -535,8 +578,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -599,8 +654,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -614,8 +668,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_11::api::core::v1::Endpoints), Created(crate::v1_11::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -790,8 +866,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -946,8 +1045,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -963,8 +1061,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/event.rs b/src/v1_11/api/core/v1/event.rs index 8e793a3c2c..4042ca66b7 100644 --- a/src/v1_11/api/core/v1/event.rs +++ b/src/v1_11/api/core/v1/event.rs @@ -106,8 +106,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_11::api::core::v1::Event), Created(crate::v1_11::api::core::v1::Event), Accepted(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -137,8 +136,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -244,8 +255,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -272,8 +282,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -352,8 +374,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -380,8 +401,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -548,8 +592,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_11::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -563,8 +606,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -627,8 +682,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -642,8 +696,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -715,8 +781,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -730,8 +795,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -795,8 +872,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_11::api::core::v1::Event), Created(crate::v1_11::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -818,8 +894,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -902,8 +989,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -974,8 +1073,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -991,8 +1089,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/limit_range.rs b/src/v1_11/api/core/v1/limit_range.rs index a8558add51..760a82dd09 100644 --- a/src/v1_11/api/core/v1/limit_range.rs +++ b/src/v1_11/api/core/v1/limit_range.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_11::api::core::v1::LimitRange), Created(crate::v1_11::api::core::v1::LimitRange), Accepted(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedLimitRangeOptional<'a> { pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { Ok((DeleteNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -415,8 +448,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -430,8 +462,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_11::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_11::api::core::v1::LimitRange), Created(crate::v1_11::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -863,8 +950,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/namespace.rs b/src/v1_11/api/core/v1/namespace.rs index 844c891c3d..3d341ae2ad 100644 --- a/src/v1_11/api/core/v1/namespace.rs +++ b/src/v1_11/api/core/v1/namespace.rs @@ -65,8 +65,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_11::api::core::v1::Namespace), Created(crate::v1_11::api::core::v1::Namespace), Accepted(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteNamespaceOptional<'a> { pub enum DeleteNamespaceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteNamespaceResponse { Ok((DeleteNamespaceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -273,8 +295,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_11::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -288,8 +309,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -347,8 +380,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -362,8 +394,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -421,8 +465,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -436,8 +479,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -504,8 +559,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -519,8 +573,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -575,8 +641,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -590,8 +655,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -650,8 +727,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_11::api::core::v1::Namespace), Created(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -673,8 +749,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_11::api::core::v1::Namespace), Created(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -756,8 +843,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -816,8 +915,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_11::api::core::v1::Namespace), Created(crate::v1_11::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -839,8 +937,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -906,8 +1016,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -923,8 +1032,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/node.rs b/src/v1_11/api/core/v1/node.rs index 068a369ac4..d2cedb1ec9 100644 --- a/src/v1_11/api/core/v1/node.rs +++ b/src/v1_11/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -900,8 +1010,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_11::api::core::v1::Node), Created(crate::v1_11::api::core::v1::Node), Accepted(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -931,8 +1040,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1033,8 +1154,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1061,8 +1181,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1136,8 +1268,7 @@ pub struct DeleteNodeOptional<'a> { pub enum DeleteNodeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1164,8 +1295,20 @@ impl crate::Response for DeleteNodeResponse { Ok((DeleteNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1238,8 +1381,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_11::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1253,8 +1395,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1312,8 +1466,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1327,8 +1480,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1386,8 +1551,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1401,8 +1565,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1469,8 +1645,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -1484,8 +1659,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -1540,8 +1727,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -1555,8 +1741,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -1615,8 +1813,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_11::api::core::v1::Node), Created(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -1638,8 +1835,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -1698,8 +1907,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_11::api::core::v1::Node), Created(crate::v1_11::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -1721,8 +1929,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -1788,8 +2008,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -1805,8 +2024,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/persistent_volume.rs b/src/v1_11/api/core/v1/persistent_volume.rs index 3a2efd0260..694ac4dfa4 100644 --- a/src/v1_11/api/core/v1/persistent_volume.rs +++ b/src/v1_11/api/core/v1/persistent_volume.rs @@ -65,8 +65,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), Created(crate::v1_11::api::core::v1::PersistentVolume), Accepted(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -198,8 +209,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeletePersistentVolumeOptional<'a> { pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeletePersistentVolumeResponse { Ok((DeletePersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -551,8 +606,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -566,8 +620,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -649,8 +714,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -705,8 +782,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -720,8 +796,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -780,8 +868,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), Created(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -803,8 +890,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -863,8 +962,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolume), Created(crate::v1_11::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -886,8 +984,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -953,8 +1063,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -970,8 +1079,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/persistent_volume_claim.rs b/src/v1_11/api/core/v1/persistent_volume_claim.rs index 91b068d880..0149c19e60 100644 --- a/src/v1_11/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_11/api/core/v1/persistent_volume_claim.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), Created(crate::v1_11::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { Ok((DeleteNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), Created(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_11::api::core::v1::PersistentVolumeClaim), Created(crate::v1_11::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/pod.rs b/src/v1_11/api/core/v1/pod.rs index 581b4c8bbc..9bcd091dbe 100644 --- a/src/v1_11/api/core/v1/pod.rs +++ b/src/v1_11/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1579,8 +1755,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_11::api::core::v1::Pod), Created(crate::v1_11::api::core::v1::Pod), Accepted(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1610,8 +1785,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1717,8 +1904,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1745,8 +1931,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1825,8 +2023,7 @@ pub struct DeleteNamespacedPodOptional<'a> { pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1853,8 +2050,20 @@ impl crate::Response for DeleteNamespacedPodResponse { Ok((DeleteNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1932,8 +2141,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_11::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1947,8 +2155,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2021,8 +2241,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2036,8 +2255,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2100,8 +2331,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2115,8 +2345,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2179,8 +2421,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2194,8 +2435,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2267,8 +2520,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2282,8 +2534,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2385,8 +2649,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -2410,8 +2673,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -2471,8 +2746,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -2486,8 +2760,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2551,8 +2837,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_11::api::core::v1::Pod), Created(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -2574,8 +2859,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2639,8 +2936,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_11::api::core::v1::Pod), Created(crate::v1_11::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -2662,8 +2958,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2734,8 +3042,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -2751,8 +3058,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2818,8 +3137,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -2835,8 +3153,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/pod_template.rs b/src/v1_11/api/core/v1/pod_template.rs index 13ca6b67de..7c2d656da3 100644 --- a/src/v1_11/api/core/v1/pod_template.rs +++ b/src/v1_11/api/core/v1/pod_template.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_11::api::core::v1::PodTemplate), Created(crate::v1_11::api::core::v1::PodTemplate), Accepted(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedPodTemplateOptional<'a> { pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { Ok((DeleteNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_11::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_11::api::core::v1::PodTemplate), Created(crate::v1_11::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/replication_controller.rs b/src/v1_11/api/core/v1/replication_controller.rs index a4ef01f604..1bab68ae70 100644 --- a/src/v1_11/api/core/v1/replication_controller.rs +++ b/src/v1_11/api/core/v1/replication_controller.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), Created(crate::v1_11::api::core::v1::ReplicationController), Accepted(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicationControllerOptional<'a> { pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { Ok((DeleteNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_11::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), Created(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_11::api::core::v1::ReplicationController), Created(crate::v1_11::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/resource_quota.rs b/src/v1_11/api/core/v1/resource_quota.rs index 0ad0773ec6..6e708cfcec 100644 --- a/src/v1_11/api/core/v1/resource_quota.rs +++ b/src/v1_11/api/core/v1/resource_quota.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), Created(crate::v1_11::api::core::v1::ResourceQuota), Accepted(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedResourceQuotaOptional<'a> { pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { Ok((DeleteNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_11::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), Created(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_11::api::core::v1::ResourceQuota), Created(crate::v1_11::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/secret.rs b/src/v1_11/api/core/v1/secret.rs index db934cfd75..accb4300da 100644 --- a/src/v1_11/api/core/v1/secret.rs +++ b/src/v1_11/api/core/v1/secret.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_11::api::core::v1::Secret), Created(crate::v1_11::api::core::v1::Secret), Accepted(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedSecretOptional<'a> { pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { Ok((DeleteNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_11::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_11::api::core::v1::Secret), Created(crate::v1_11::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/service.rs b/src/v1_11/api/core/v1/service.rs index ead88df0b5..e49a05d925 100644 --- a/src/v1_11/api/core/v1/service.rs +++ b/src/v1_11/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -955,8 +1065,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_11::api::core::v1::Service), Created(crate::v1_11::api::core::v1::Service), Accepted(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -986,8 +1095,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1066,8 +1187,7 @@ pub struct DeleteNamespacedServiceOptional<'a> { pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1094,8 +1214,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { Ok((DeleteNamespacedServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1173,8 +1305,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_11::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1188,8 +1319,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1262,8 +1405,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1277,8 +1419,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1341,8 +1495,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1356,8 +1509,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1420,8 +1585,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1435,8 +1599,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1508,8 +1684,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -1523,8 +1698,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1584,8 +1771,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -1599,8 +1785,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1664,8 +1862,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_11::api::core::v1::Service), Created(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -1687,8 +1884,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1752,8 +1961,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_11::api::core::v1::Service), Created(crate::v1_11::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -1775,8 +1983,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1847,8 +2067,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -1864,8 +2083,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1931,8 +2162,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -1948,8 +2178,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/core/v1/service_account.rs b/src/v1_11/api/core/v1/service_account.rs index 31b9fa8020..e672c071eb 100644 --- a/src/v1_11/api/core/v1/service_account.rs +++ b/src/v1_11/api/core/v1/service_account.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_11::api::core::v1::ServiceAccount), Created(crate::v1_11::api::core::v1::ServiceAccount), Accepted(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedServiceAccountOptional<'a> { pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { Ok((DeleteNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_11::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_11::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_11::api::core::v1::ServiceAccount), Created(crate::v1_11::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/events/v1beta1/event.rs b/src/v1_11/api/events/v1beta1/event.rs index 88ea34f1f7..59eb509a00 100644 --- a/src/v1_11/api/events/v1beta1/event.rs +++ b/src/v1_11/api/events/v1beta1/event.rs @@ -105,8 +105,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_11::api::events::v1beta1::Event), Created(crate::v1_11::api::events::v1beta1::Event), Accepted(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -136,8 +135,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -243,8 +254,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -271,8 +281,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -351,8 +373,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -379,8 +400,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -453,8 +486,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_11::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -468,8 +500,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -547,8 +591,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_11::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -562,8 +605,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -794,8 +871,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_11::api::events::v1beta1::Event), Created(crate::v1_11::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -817,8 +893,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -884,8 +972,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -901,8 +988,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -973,8 +1072,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -990,8 +1088,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/daemon_set.rs b/src/v1_11/api/extensions/v1beta1/daemon_set.rs index e68dd35372..36fa852a4e 100644 --- a/src/v1_11/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_11/api/extensions/v1beta1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), Created(crate::v1_11::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), Created(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::DaemonSet), Created(crate::v1_11::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/deployment.rs b/src/v1_11/api/extensions/v1beta1/deployment.rs index 301df5ba06..1ae73a6937 100644 --- a/src/v1_11/api/extensions/v1beta1/deployment.rs +++ b/src/v1_11/api/extensions/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), Created(crate::v1_11::api::extensions::v1beta1::Deployment), Accepted(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_11::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_11::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), Created(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Deployment), Created(crate::v1_11::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_11/api/extensions/v1beta1/deployment_rollback.rs index 39ed07ede9..e0a2db34f7 100644 --- a/src/v1_11/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_11/api/extensions/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_11::api::extensions::v1beta1::DeploymentRollback), Created(crate::v1_11::api::extensions::v1beta1::DeploymentRollback), Accepted(crate::v1_11::api::extensions::v1beta1::DeploymentRollback), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/ingress.rs b/src/v1_11/api/extensions/v1beta1/ingress.rs index eeaa24639d..420d4fc096 100644 --- a/src/v1_11/api/extensions/v1beta1/ingress.rs +++ b/src/v1_11/api/extensions/v1beta1/ingress.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), Created(crate::v1_11::api::extensions::v1beta1::Ingress), Accepted(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedIngressOptional<'a> { pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { Ok((DeleteNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_11::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_11::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), Created(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::Ingress), Created(crate::v1_11::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/network_policy.rs b/src/v1_11/api/extensions/v1beta1/network_policy.rs index fde0636a04..d2fa4eb200 100644 --- a/src/v1_11/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_11/api/extensions/v1beta1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_11::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_11/api/extensions/v1beta1/pod_security_policy.rs index 3414cdc2bb..801f4e6fb8 100644 --- a/src/v1_11/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_11/api/extensions/v1beta1/pod_security_policy.rs @@ -62,8 +62,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_11::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/replica_set.rs b/src/v1_11/api/extensions/v1beta1/replica_set.rs index 44ba4dcbdf..98e6603b30 100644 --- a/src/v1_11/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_11/api/extensions/v1beta1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_11::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_11::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_11::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/extensions/v1beta1/scale.rs b/src/v1_11/api/extensions/v1beta1/scale.rs index b879693a47..9fde59476a 100644 --- a/src/v1_11/api/extensions/v1beta1/scale.rs +++ b/src/v1_11/api/extensions/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), Created(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), Created(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_11::api::extensions::v1beta1::Scale), Created(crate::v1_11::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/networking/v1/network_policy.rs b/src/v1_11/api/networking/v1/network_policy.rs index 9006fe3cd7..493e81cb68 100644 --- a/src/v1_11/api/networking/v1/network_policy.rs +++ b/src/v1_11/api/networking/v1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicy), Created(crate::v1_11::api::networking::v1::NetworkPolicy), Accepted(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_11::api::networking::v1::NetworkPolicy), Created(crate::v1_11::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/policy/v1beta1/eviction.rs b/src/v1_11/api/policy/v1beta1/eviction.rs index 00c57d5780..5447a50906 100644 --- a/src/v1_11/api/policy/v1beta1/eviction.rs +++ b/src/v1_11/api/policy/v1beta1/eviction.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_11::api::policy::v1beta1::Eviction), Created(crate::v1_11::api::policy::v1beta1::Eviction), Accepted(crate::v1_11::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_11/api/policy/v1beta1/pod_disruption_budget.rs index ca7d2a12b0..27be28779e 100644 --- a/src/v1_11/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_11/api/policy/v1beta1/pod_disruption_budget.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -207,8 +218,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -235,8 +245,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { Ok((DeleteNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -526,8 +569,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -590,8 +645,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -605,8 +659,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -669,8 +735,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -684,8 +749,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -757,8 +834,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -772,8 +848,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -833,8 +921,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -848,8 +935,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -913,8 +1012,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -936,8 +1034,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1001,8 +1111,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_11::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1024,8 +1133,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1096,8 +1217,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1113,8 +1233,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1180,8 +1312,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1197,8 +1328,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/policy/v1beta1/pod_security_policy.rs b/src/v1_11/api/policy/v1beta1/pod_security_policy.rs index eb338a0501..d333645f2d 100644 --- a/src/v1_11/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_11/api/policy/v1beta1/pod_security_policy.rs @@ -62,8 +62,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_11::api::policy::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_11::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1/cluster_role.rs b/src/v1_11/api/rbac/v1/cluster_role.rs index 542b894de9..6350450bbc 100644 --- a/src/v1_11/api/rbac/v1/cluster_role.rs +++ b/src/v1_11/api/rbac/v1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRole), Created(crate::v1_11::api::rbac::v1::ClusterRole), Accepted(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRole), Created(crate::v1_11::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1/cluster_role_binding.rs b/src/v1_11/api/rbac/v1/cluster_role_binding.rs index d6a83d3c8f..112cf710d9 100644 --- a/src/v1_11/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_11/api/rbac/v1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1/role.rs b/src/v1_11/api/rbac/v1/role.rs index ddbd24c9b6..2131f72116 100644 --- a/src/v1_11/api/rbac/v1/role.rs +++ b/src/v1_11/api/rbac/v1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1::Role), Created(crate::v1_11::api::rbac::v1::Role), Accepted(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1::Role), Created(crate::v1_11::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1/role_binding.rs b/src/v1_11/api/rbac/v1/role_binding.rs index 284c9d61f5..c3c0a01823 100644 --- a/src/v1_11/api/rbac/v1/role_binding.rs +++ b/src/v1_11/api/rbac/v1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::RoleBinding), Created(crate::v1_11::api::rbac::v1::RoleBinding), Accepted(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1::RoleBinding), Created(crate::v1_11::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1alpha1/cluster_role.rs b/src/v1_11/api/rbac/v1alpha1/cluster_role.rs index 50fc4bacb9..fb39f0891c 100644 --- a/src/v1_11/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_11/api/rbac/v1alpha1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_11::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_11::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_11/api/rbac/v1alpha1/cluster_role_binding.rs index 9f18bcec8d..a32a182f4b 100644 --- a/src/v1_11/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_11/api/rbac/v1alpha1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1alpha1/role.rs b/src/v1_11/api/rbac/v1alpha1/role.rs index 26786915df..b22db5d262 100644 --- a/src/v1_11/api/rbac/v1alpha1/role.rs +++ b/src/v1_11/api/rbac/v1alpha1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::Role), Created(crate::v1_11::api::rbac::v1alpha1::Role), Accepted(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1alpha1::Role), Created(crate::v1_11::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1alpha1/role_binding.rs b/src/v1_11/api/rbac/v1alpha1/role_binding.rs index becf1073c3..410aca9376 100644 --- a/src/v1_11/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_11/api/rbac/v1alpha1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_11::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_11::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1beta1/cluster_role.rs b/src/v1_11/api/rbac/v1beta1/cluster_role.rs index 034d94f034..9c0ffff3c2 100644 --- a/src/v1_11/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_11/api/rbac/v1beta1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRole), Created(crate::v1_11::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRole), Created(crate::v1_11::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_11/api/rbac/v1beta1/cluster_role_binding.rs index 1e8ecc5414..8d70d88ef3 100644 --- a/src/v1_11/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_11/api/rbac/v1beta1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_11::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1beta1/role.rs b/src/v1_11/api/rbac/v1beta1/role.rs index 2cc4b17751..cf05fe19d4 100644 --- a/src/v1_11/api/rbac/v1beta1/role.rs +++ b/src/v1_11/api/rbac/v1beta1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::Role), Created(crate::v1_11::api::rbac::v1beta1::Role), Accepted(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_11::api::rbac::v1beta1::Role), Created(crate::v1_11::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/rbac/v1beta1/role_binding.rs b/src/v1_11/api/rbac/v1beta1/role_binding.rs index 428b93fcc0..8f68ca8eff 100644 --- a/src/v1_11/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_11/api/rbac/v1beta1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBinding), Created(crate::v1_11::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_11::api::rbac::v1beta1::RoleBinding), Created(crate::v1_11::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/scheduling/v1alpha1/priority_class.rs b/src/v1_11/api/scheduling/v1alpha1/priority_class.rs index 81c15ba5d3..60993dd699 100644 --- a/src/v1_11/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_11/api/scheduling/v1alpha1/priority_class.rs @@ -68,8 +68,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -99,8 +98,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -201,8 +212,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -229,8 +239,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -304,8 +326,7 @@ pub struct DeletePriorityClassOptional<'a> { pub enum DeletePriorityClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -332,8 +353,20 @@ impl crate::Response for DeletePriorityClassResponse { Ok((DeletePriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -406,8 +439,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -421,8 +453,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -480,8 +524,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -495,8 +538,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -563,8 +618,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -578,8 +632,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -638,8 +704,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_11::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -745,8 +821,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/scheduling/v1beta1/priority_class.rs b/src/v1_11/api/scheduling/v1beta1/priority_class.rs index 397d0716c7..8b74d9c0fb 100644 --- a/src/v1_11/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_11/api/scheduling/v1beta1/priority_class.rs @@ -68,8 +68,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_11::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -99,8 +98,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -201,8 +212,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -229,8 +239,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -304,8 +326,7 @@ pub struct DeletePriorityClassOptional<'a> { pub enum DeletePriorityClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -332,8 +353,20 @@ impl crate::Response for DeletePriorityClassResponse { Ok((DeletePriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -406,8 +439,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1beta1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -421,8 +453,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -480,8 +524,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -495,8 +538,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -563,8 +618,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -578,8 +632,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -638,8 +704,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_11::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_11::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -745,8 +821,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/settings/v1alpha1/pod_preset.rs b/src/v1_11/api/settings/v1alpha1/pod_preset.rs index 2edfe3268f..d3e6a18d95 100644 --- a/src/v1_11/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_11/api/settings/v1alpha1/pod_preset.rs @@ -65,8 +65,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPreset), Created(crate::v1_11::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -311,8 +333,7 @@ pub struct DeleteNamespacedPodPresetOptional<'a> { pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -339,8 +360,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { Ok((DeleteNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -507,8 +551,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -522,8 +565,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -586,8 +641,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -601,8 +655,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_11::api::settings::v1alpha1::PodPreset), Created(crate::v1_11::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -777,8 +853,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -933,8 +1032,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -950,8 +1048,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/storage/v1/storage_class.rs b/src/v1_11/api/storage/v1/storage_class.rs index 3fdd3f596d..ecfcbf3ee4 100644 --- a/src/v1_11/api/storage/v1/storage_class.rs +++ b/src/v1_11/api/storage/v1/storage_class.rs @@ -82,8 +82,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_11::api::storage::v1::StorageClass), Created(crate::v1_11::api::storage::v1::StorageClass), Accepted(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_11::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -509,8 +552,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -577,8 +632,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -592,8 +646,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_11::api::storage::v1::StorageClass), Created(crate::v1_11::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -675,8 +740,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -742,8 +819,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -759,8 +835,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/storage/v1alpha1/volume_attachment.rs b/src/v1_11/api/storage/v1alpha1/volume_attachment.rs index cc7a3b16a0..ee387ff3dd 100644 --- a/src/v1_11/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_11/api/storage/v1alpha1/volume_attachment.rs @@ -67,8 +67,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -200,8 +211,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -228,8 +238,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -303,8 +325,7 @@ pub struct DeleteVolumeAttachmentOptional<'a> { pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -331,8 +352,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { Ok((DeleteVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -479,8 +523,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -494,8 +537,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -562,8 +617,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -577,8 +631,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -637,8 +703,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_11::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -660,8 +725,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -727,8 +804,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -744,8 +820,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/storage/v1beta1/storage_class.rs b/src/v1_11/api/storage/v1beta1/storage_class.rs index f556751781..8c1664d3a5 100644 --- a/src/v1_11/api/storage/v1beta1/storage_class.rs +++ b/src/v1_11/api/storage/v1beta1/storage_class.rs @@ -82,8 +82,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_11::api::storage::v1beta1::StorageClass), Created(crate::v1_11::api::storage::v1beta1::StorageClass), Accepted(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_11::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -509,8 +552,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -577,8 +632,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -592,8 +646,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_11::api::storage::v1beta1::StorageClass), Created(crate::v1_11::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -675,8 +740,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -742,8 +819,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -759,8 +835,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/api/storage/v1beta1/volume_attachment.rs b/src/v1_11/api/storage/v1beta1/volume_attachment.rs index 84df83ebf0..7c021f8f22 100644 --- a/src/v1_11/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_11/api/storage/v1beta1/volume_attachment.rs @@ -67,8 +67,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_11::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -200,8 +211,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -228,8 +238,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -303,8 +325,7 @@ pub struct DeleteVolumeAttachmentOptional<'a> { pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -331,8 +352,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { Ok((DeleteVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1beta1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -479,8 +523,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -494,8 +537,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -562,8 +617,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -577,8 +631,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -637,8 +703,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_11::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_11::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -660,8 +725,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -727,8 +804,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -744,8 +820,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_11/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index e42d073a7f..65b7654832 100644 --- a/src/v1_11/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_11/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -64,8 +64,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -197,8 +208,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCustomResourceDefinitionOptional<'a> { pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { Ok((DeleteCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -550,8 +605,7 @@ pub struct PatchCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionStatusResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionStatusResponse { @@ -565,8 +619,20 @@ impl crate::Response for PatchCustomResourceDefinitionStatusResponse { }; Ok((PatchCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -633,8 +699,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -648,8 +713,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -704,8 +781,7 @@ pub struct ReadCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionStatusResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionStatusResponse { @@ -719,8 +795,20 @@ impl crate::Response for ReadCustomResourceDefinitionStatusResponse { }; Ok((ReadCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -779,8 +867,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -802,8 +889,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -862,8 +961,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_11::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -885,8 +983,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -952,8 +1062,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -969,8 +1078,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 37e6442c3b..c04ad2e20a 100644 --- a/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -64,8 +64,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -550,8 +605,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -565,8 +619,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -633,8 +699,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -648,8 +713,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -704,8 +781,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -719,8 +795,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -779,8 +867,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -802,8 +889,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -862,8 +961,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -885,8 +983,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -952,8 +1062,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -969,8 +1078,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index d46d9ca396..9577bb830b 100644 --- a/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_11/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -64,8 +64,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_11::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -550,8 +605,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -565,8 +619,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -633,8 +699,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -648,8 +713,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -704,8 +781,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -719,8 +795,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -779,8 +867,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -802,8 +889,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -862,8 +961,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_11::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -885,8 +983,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -952,8 +1062,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -969,8 +1078,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_11/mod.rs b/src/v1_11/mod.rs index 5110438987..da3ae775fd 100644 --- a/src/v1_11/mod.rs +++ b/src/v1_11/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1APIResourcesResponse { }; Ok((GetApiregistrationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_11::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_scheduling_v1beta1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { }; Ok((GetSchedulingV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2138,8 +2688,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2153,8 +2702,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2180,8 +2741,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_11::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2195,8 +2755,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2226,15 +2798,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2257,15 +2840,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_12/api/admissionregistration/v1alpha1/initializer_configuration.rs index 226f6da8ed..dbec25d2f3 100644 --- a/src/v1_12/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_12/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { }; Ok((DeleteInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_12::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_12/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index d6cc6499a3..eb717f8ffd 100644 --- a/src/v1_12/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_12/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { }; Ok((DeleteMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_12::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_12/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 17b26135e3..4683273d33 100644 --- a/src/v1_12/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_12/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { }; Ok((DeleteValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_12::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1/controller_revision.rs b/src/v1_12/api/apps/v1/controller_revision.rs index 088a6a53f0..99ddf53ac0 100644 --- a/src/v1_12/api/apps/v1/controller_revision.rs +++ b/src/v1_12/api/apps/v1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevision), Created(crate::v1_12::api::apps::v1::ControllerRevision), Accepted(crate::v1_12::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::ControllerRevision), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1::ControllerRevision), Created(crate::v1_12::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1/daemon_set.rs b/src/v1_12/api/apps/v1/daemon_set.rs index 4d27a855a5..dc0d3f11c8 100644 --- a/src/v1_12/api/apps/v1/daemon_set.rs +++ b/src/v1_12/api/apps/v1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), Created(crate::v1_12::api::apps::v1::DaemonSet), Accepted(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::DaemonSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), Created(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1::DaemonSet), Created(crate::v1_12::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1/deployment.rs b/src/v1_12/api/apps/v1/deployment.rs index 8846d503f2..f3b26bef8f 100644 --- a/src/v1_12/api/apps/v1/deployment.rs +++ b/src/v1_12/api/apps/v1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1::Deployment), Created(crate::v1_12::api::apps::v1::Deployment), Accepted(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::Deployment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1::Deployment), Created(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1::Deployment), Created(crate::v1_12::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1/replica_set.rs b/src/v1_12/api/apps/v1/replica_set.rs index e0f77e0553..b9f9a599b8 100644 --- a/src/v1_12/api/apps/v1/replica_set.rs +++ b/src/v1_12/api/apps/v1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), Created(crate::v1_12::api::apps::v1::ReplicaSet), Accepted(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::ReplicaSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), Created(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1::ReplicaSet), Created(crate::v1_12::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1/stateful_set.rs b/src/v1_12/api/apps/v1/stateful_set.rs index 4e1b74b293..80ae0366f6 100644 --- a/src/v1_12/api/apps/v1/stateful_set.rs +++ b/src/v1_12/api/apps/v1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), Created(crate::v1_12::api::apps::v1::StatefulSet), Accepted(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1::StatefulSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), Created(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1::StatefulSet), Created(crate::v1_12::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta1/controller_revision.rs b/src/v1_12/api/apps/v1beta1/controller_revision.rs index c021f83f9a..bd63b54f0c 100644 --- a/src/v1_12/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_12/api/apps/v1beta1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevision), Created(crate::v1_12::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_12::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta1::ControllerRevision), Created(crate::v1_12::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta1/deployment.rs b/src/v1_12/api/apps/v1beta1/deployment.rs index 969161cbe6..efe8317bf2 100644 --- a/src/v1_12/api/apps/v1beta1/deployment.rs +++ b/src/v1_12/api/apps/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), Created(crate::v1_12::api::apps::v1beta1::Deployment), Accepted(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::Deployment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), Created(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::Deployment), Created(crate::v1_12::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta1/deployment_rollback.rs b/src/v1_12/api/apps/v1beta1/deployment_rollback.rs index 8ca3606f9f..8bfb3b6be1 100644 --- a/src/v1_12/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_12/api/apps/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta1/scale.rs b/src/v1_12/api/apps/v1beta1/scale.rs index b39952b6f8..ba35a62ae4 100644 --- a/src/v1_12/api/apps/v1beta1/scale.rs +++ b/src/v1_12/api/apps/v1beta1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -240,8 +262,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -255,8 +276,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -316,8 +349,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -331,8 +363,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -402,8 +446,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), Created(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -425,8 +468,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -496,8 +551,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta1::Scale), Created(crate::v1_12::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -519,8 +573,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta1/stateful_set.rs b/src/v1_12/api/apps/v1beta1/stateful_set.rs index 38faf7480c..5682d47a09 100644 --- a/src/v1_12/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_12/api/apps/v1beta1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), Created(crate::v1_12::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), Created(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta1::StatefulSet), Created(crate::v1_12::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/controller_revision.rs b/src/v1_12/api/apps/v1beta2/controller_revision.rs index c6fdf5c06b..c9493d194c 100644 --- a/src/v1_12/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_12/api/apps/v1beta2/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevision), Created(crate::v1_12::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_12::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_12::api::apps::v1beta2::ControllerRevision), Created(crate::v1_12::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/daemon_set.rs b/src/v1_12/api/apps/v1beta2/daemon_set.rs index 6736836333..a1854be108 100644 --- a/src/v1_12/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_12/api/apps/v1beta2/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), Created(crate::v1_12::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), Created(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::DaemonSet), Created(crate::v1_12::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/deployment.rs b/src/v1_12/api/apps/v1beta2/deployment.rs index 27e4e5dcf6..4a55707f2d 100644 --- a/src/v1_12/api/apps/v1beta2/deployment.rs +++ b/src/v1_12/api/apps/v1beta2/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), Created(crate::v1_12::api::apps::v1beta2::Deployment), Accepted(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::Deployment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), Created(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::Deployment), Created(crate::v1_12::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/replica_set.rs b/src/v1_12/api/apps/v1beta2/replica_set.rs index 1189534cfa..de76471efe 100644 --- a/src/v1_12/api/apps/v1beta2/replica_set.rs +++ b/src/v1_12/api/apps/v1beta2/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), Created(crate::v1_12::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), Created(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::ReplicaSet), Created(crate::v1_12::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/scale.rs b/src/v1_12/api/apps/v1beta2/scale.rs index 6c3badf68c..b41f2853c1 100644 --- a/src/v1_12/api/apps/v1beta2/scale.rs +++ b/src/v1_12/api/apps/v1beta2/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -325,8 +358,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -340,8 +372,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -401,8 +445,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -416,8 +459,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -477,8 +532,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -492,8 +546,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -563,8 +629,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), Created(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -586,8 +651,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -657,8 +734,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), Created(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -680,8 +756,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -751,8 +839,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::apps::v1beta2::Scale), Created(crate::v1_12::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -774,8 +861,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/apps/v1beta2/stateful_set.rs b/src/v1_12/api/apps/v1beta2/stateful_set.rs index c56e03c52a..63b4aabcae 100644 --- a/src/v1_12/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_12/api/apps/v1beta2/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), Created(crate::v1_12::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), Created(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_12::api::apps::v1beta2::StatefulSet), Created(crate::v1_12::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authentication/v1/token_review.rs b/src/v1_12/api/authentication/v1/token_review.rs index 594f2f0b92..eefae878b7 100644 --- a/src/v1_12/api/authentication/v1/token_review.rs +++ b/src/v1_12/api/authentication/v1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_12::api::authentication::v1::TokenReview), Created(crate::v1_12::api::authentication::v1::TokenReview), Accepted(crate::v1_12::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authentication/v1beta1/token_review.rs b/src/v1_12/api/authentication/v1beta1/token_review.rs index ac82925403..b338c97495 100644 --- a/src/v1_12/api/authentication/v1beta1/token_review.rs +++ b/src/v1_12/api/authentication/v1beta1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_12::api::authentication::v1beta1::TokenReview), Created(crate::v1_12::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_12::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1/local_subject_access_review.rs b/src/v1_12/api/authorization/v1/local_subject_access_review.rs index 98b4fa68d5..8243da0821 100644 --- a/src/v1_12/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_12/api/authorization/v1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_12::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1/self_subject_access_review.rs b/src/v1_12/api/authorization/v1/self_subject_access_review.rs index fe63d7e615..8fdf06d1a8 100644 --- a/src/v1_12/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_12/api/authorization/v1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_12::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1/self_subject_rules_review.rs b/src/v1_12/api/authorization/v1/self_subject_rules_review.rs index 20da873dc4..ebe3ee1aec 100644 --- a/src/v1_12/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_12/api/authorization/v1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_12::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_12::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_12::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1/subject_access_review.rs b/src/v1_12/api/authorization/v1/subject_access_review.rs index afff578c7f..b16b73e49a 100644 --- a/src/v1_12/api/authorization/v1/subject_access_review.rs +++ b/src/v1_12/api/authorization/v1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1::SubjectAccessReview), Created(crate::v1_12::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_12/api/authorization/v1beta1/local_subject_access_review.rs index 44b1a08f93..0f2de8bf4e 100644 --- a/src/v1_12/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_12/api/authorization/v1beta1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_12::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_12/api/authorization/v1beta1/self_subject_access_review.rs index bd1a467e81..279f5a2539 100644 --- a/src/v1_12/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_12/api/authorization/v1beta1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_12::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_12/api/authorization/v1beta1/self_subject_rules_review.rs index 7716e41f0b..a9a3d01e58 100644 --- a/src/v1_12/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_12/api/authorization/v1beta1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_12::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_12::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_12::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/authorization/v1beta1/subject_access_review.rs b/src/v1_12/api/authorization/v1beta1/subject_access_review.rs index a80cfa6ab9..7122bf5950 100644 --- a/src/v1_12/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_12/api/authorization/v1beta1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_12::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_12::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_12::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_12/api/autoscaling/v1/horizontal_pod_autoscaler.rs index a1493c36b1..4546e5d017 100644 --- a/src/v1_12/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_12/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/autoscaling/v1/scale.rs b/src/v1_12/api/autoscaling/v1/scale.rs index 7d93f517f7..56dd65dabe 100644 --- a/src/v1_12/api/autoscaling/v1/scale.rs +++ b/src/v1_12/api/autoscaling/v1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -334,8 +367,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -349,8 +381,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -410,8 +454,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -425,8 +468,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -486,8 +541,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -501,8 +555,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -562,8 +628,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -577,8 +642,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -638,8 +715,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -653,8 +729,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -724,8 +812,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), Created(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -747,8 +834,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -818,8 +917,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), Created(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -841,8 +939,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -912,8 +1022,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), Created(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -935,8 +1044,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -1006,8 +1127,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_12::api::autoscaling::v1::Scale), Created(crate::v1_12::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -1029,8 +1149,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_12/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index 5c99bcdf43..a551ce6055 100644 --- a/src/v1_12/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_12/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs b/src/v1_12/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs index af3c7ba594..2c0a897bb8 100644 --- a/src/v1_12/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs +++ b/src/v1_12/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_12::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/batch/v1/job.rs b/src/v1_12/api/batch/v1/job.rs index 0cc0525b3b..9f85f8d8b2 100644 --- a/src/v1_12/api/batch/v1/job.rs +++ b/src/v1_12/api/batch/v1/job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_12::api::batch::v1::Job), Created(crate::v1_12::api::batch::v1::Job), Accepted(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v1::Job), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedJobResponse { }; Ok((DeleteNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_12::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_12::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_12::api::batch::v1::Job), Created(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_12::api::batch::v1::Job), Created(crate::v1_12::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/batch/v1beta1/cron_job.rs b/src/v1_12/api/batch/v1beta1/cron_job.rs index ee8a154a0c..e47a0983ed 100644 --- a/src/v1_12/api/batch/v1beta1/cron_job.rs +++ b/src/v1_12/api/batch/v1beta1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), Created(crate::v1_12::api::batch::v1beta1::CronJob), Accepted(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v1beta1::CronJob), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), Created(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v1beta1::CronJob), Created(crate::v1_12::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/batch/v2alpha1/cron_job.rs b/src/v1_12/api/batch/v2alpha1/cron_job.rs index 8e9f07d6ae..756ef87823 100644 --- a/src/v1_12/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_12/api/batch/v2alpha1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), Created(crate::v1_12::api::batch::v2alpha1::CronJob), Accepted(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::batch::v2alpha1::CronJob), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), Created(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_12::api::batch::v2alpha1::CronJob), Created(crate::v1_12::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_12/api/certificates/v1beta1/certificate_signing_request.rs index e2354d5d04..b64451c2e9 100644 --- a/src/v1_12/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_12/api/certificates/v1beta1/certificate_signing_request.rs @@ -76,8 +76,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { }; Ok((DeleteCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestStatusResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchCertificateSigningRequestStatusResponse { }; Ok((PatchCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestStatusResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadCertificateSigningRequestStatusResponse { }; Ok((ReadCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_12::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -1094,8 +1215,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -1111,8 +1231,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/coordination/v1beta1/lease.rs b/src/v1_12/api/coordination/v1beta1/lease.rs index dbe78f6ca0..c4483b8f43 100644 --- a/src/v1_12/api/coordination/v1beta1/lease.rs +++ b/src/v1_12/api/coordination/v1beta1/lease.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLeaseResponse { Ok(crate::v1_12::api::coordination::v1beta1::Lease), Created(crate::v1_12::api::coordination::v1beta1::Lease), Accepted(crate::v1_12::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLeaseResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLeaseResponse { }; Ok((CreateNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedLeaseOptional<'a> { pub enum DeleteCollectionNamespacedLeaseResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLeaseResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedLeaseResponse { Ok((DeleteCollectionNamespacedLeaseResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedLeaseResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::coordination::v1beta1::Lease), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLeaseResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedLeaseResponse { }; Ok((DeleteNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl Lease { #[derive(Debug)] pub enum ListLeaseForAllNamespacesResponse { Ok(crate::v1_12::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLeaseForAllNamespacesResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListLeaseForAllNamespacesResponse { }; Ok((ListLeaseForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Lease { #[derive(Debug)] pub enum ListNamespacedLeaseResponse { Ok(crate::v1_12::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLeaseResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNamespacedLeaseResponse { }; Ok((ListNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLeaseResponse { Ok(crate::v1_12::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLeaseResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedLeaseResponse { }; Ok((PatchNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLeaseResponse { Ok(crate::v1_12::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLeaseResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedLeaseResponse { }; Ok((ReadNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedLeaseOptional<'a> { pub enum ReplaceNamespacedLeaseResponse { Ok(crate::v1_12::api::coordination::v1beta1::Lease), Created(crate::v1_12::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLeaseResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedLeaseResponse { }; Ok((ReplaceNamespacedLeaseResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl Lease { #[derive(Debug)] pub enum WatchLeaseForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLeaseForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLeaseForAllNamespacesResponse { }; Ok((WatchLeaseForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl Lease { #[derive(Debug)] pub enum WatchNamespacedLeaseResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLeaseResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNamespacedLeaseResponse { }; Ok((WatchNamespacedLeaseResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLeaseResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/binding.rs b/src/v1_12/api/core/v1/binding.rs index 3c5095c2e3..ffca5727dd 100644 --- a/src/v1_12/api/core/v1/binding.rs +++ b/src/v1_12/api/core/v1/binding.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_12::api::core::v1::Binding), Created(crate::v1_12::api::core::v1::Binding), Accepted(crate::v1_12::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_12::api::core::v1::Binding), Created(crate::v1_12::api::core::v1::Binding), Accepted(crate::v1_12::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -219,8 +229,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/component_status.rs b/src/v1_12/api/core/v1/component_status.rs index 16c17f45db..2416ebb493 100644 --- a/src/v1_12/api/core/v1/component_status.rs +++ b/src/v1_12/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_12::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_12::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/config_map.rs b/src/v1_12/api/core/v1/config_map.rs index bcb1488f6b..dc785e7fdf 100644 --- a/src/v1_12/api/core/v1/config_map.rs +++ b/src/v1_12/api/core/v1/config_map.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_12::api::core::v1::ConfigMap), Created(crate::v1_12::api::core::v1::ConfigMap), Accepted(crate::v1_12::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ConfigMap), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { }; Ok((DeleteNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_12::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_12::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_12::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_12::api::core::v1::ConfigMap), Created(crate::v1_12::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/endpoints.rs b/src/v1_12/api/core/v1/endpoints.rs index 82de9f9ef3..84d55342e4 100644 --- a/src/v1_12/api/core/v1/endpoints.rs +++ b/src/v1_12/api/core/v1/endpoints.rs @@ -90,8 +90,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_12::api::core::v1::Endpoints), Created(crate::v1_12::api::core::v1::Endpoints), Accepted(crate::v1_12::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -121,8 +120,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -230,8 +241,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -258,8 +268,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -345,8 +367,7 @@ pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Endpoints), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -381,8 +402,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { }; Ok((DeleteNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -549,8 +593,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_12::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -564,8 +607,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -634,8 +689,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_12::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -649,8 +703,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -722,8 +788,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_12::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -737,8 +802,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -808,8 +885,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_12::api::core::v1::Endpoints), Created(crate::v1_12::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -831,8 +907,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -987,8 +1086,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -1004,8 +1102,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/event.rs b/src/v1_12/api/core/v1/event.rs index 1c89cfd653..39820d7eae 100644 --- a/src/v1_12/api/core/v1/event.rs +++ b/src/v1_12/api/core/v1/event.rs @@ -118,8 +118,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_12::api::core::v1::Event), Created(crate::v1_12::api::core::v1::Event), Accepted(crate::v1_12::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -149,8 +148,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -258,8 +269,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -286,8 +296,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -373,8 +395,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Event), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -409,8 +430,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -483,8 +516,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -498,8 +530,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -577,8 +621,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_12::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -592,8 +635,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -662,8 +717,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_12::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -677,8 +731,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -750,8 +816,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_12::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -765,8 +830,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -836,8 +913,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_12::api::core::v1::Event), Created(crate::v1_12::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -859,8 +935,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -926,8 +1014,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -943,8 +1030,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1015,8 +1114,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1032,8 +1130,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/limit_range.rs b/src/v1_12/api/core/v1/limit_range.rs index 3eb77d7b5f..398894ce7e 100644 --- a/src/v1_12/api/core/v1/limit_range.rs +++ b/src/v1_12/api/core/v1/limit_range.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_12::api::core::v1::LimitRange), Created(crate::v1_12::api::core::v1::LimitRange), Accepted(crate::v1_12::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::LimitRange), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { }; Ok((DeleteNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_12::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_12::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_12::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_12::api::core::v1::LimitRange), Created(crate::v1_12::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/namespace.rs b/src/v1_12/api/core/v1/namespace.rs index d2d615fb39..4ac725c2ae 100644 --- a/src/v1_12/api/core/v1/namespace.rs +++ b/src/v1_12/api/core/v1/namespace.rs @@ -77,8 +77,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_12::api::core::v1::Namespace), Created(crate::v1_12::api::core::v1::Namespace), Accepted(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteNamespaceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Namespace), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteNamespaceResponse { }; Ok((DeleteNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_12::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -315,8 +336,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -380,8 +413,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -395,8 +427,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -460,8 +504,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -475,8 +518,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -543,8 +598,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -558,8 +612,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -614,8 +680,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -629,8 +694,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -695,8 +772,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_12::api::core::v1::Namespace), Created(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -718,8 +794,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -784,8 +872,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_12::api::core::v1::Namespace), Created(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -807,8 +894,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -873,8 +972,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_12::api::core::v1::Namespace), Created(crate::v1_12::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -896,8 +994,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1073,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -980,8 +1089,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/node.rs b/src/v1_12/api/core/v1/node.rs index 1123116d6a..afd45a2243 100644 --- a/src/v1_12/api/core/v1/node.rs +++ b/src/v1_12/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -912,8 +1022,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_12::api::core::v1::Node), Created(crate::v1_12::api::core::v1::Node), Accepted(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -943,8 +1052,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1047,8 +1168,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1075,8 +1195,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1157,8 +1289,7 @@ pub enum DeleteNodeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Node), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1193,8 +1324,20 @@ impl crate::Response for DeleteNodeResponse { }; Ok((DeleteNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1267,8 +1410,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_12::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1282,8 +1424,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1347,8 +1501,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1362,8 +1515,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1427,8 +1592,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1442,8 +1606,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1510,8 +1686,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -1525,8 +1700,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -1581,8 +1768,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -1596,8 +1782,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -1662,8 +1860,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_12::api::core::v1::Node), Created(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -1685,8 +1882,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -1751,8 +1960,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_12::api::core::v1::Node), Created(crate::v1_12::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -1774,8 +1982,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -1841,8 +2061,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -1858,8 +2077,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/persistent_volume.rs b/src/v1_12/api/core/v1/persistent_volume.rs index 6154483f8a..02ddb7d48c 100644 --- a/src/v1_12/api/core/v1/persistent_volume.rs +++ b/src/v1_12/api/core/v1/persistent_volume.rs @@ -77,8 +77,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), Created(crate::v1_12::api::core::v1::PersistentVolume), Accepted(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -322,8 +344,7 @@ pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PersistentVolume), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeletePersistentVolumeResponse { }; Ok((DeletePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -607,8 +661,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -675,8 +741,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -690,8 +755,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -746,8 +823,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -761,8 +837,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), Created(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -850,8 +937,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolume), Created(crate::v1_12::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -1006,8 +1116,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -1023,8 +1132,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/persistent_volume_claim.rs b/src/v1_12/api/core/v1/persistent_volume_claim.rs index df318b8647..f66fb31478 100644 --- a/src/v1_12/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_12/api/core/v1/persistent_volume_claim.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), Created(crate::v1_12::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { }; Ok((DeleteNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), Created(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_12::api::core::v1::PersistentVolumeClaim), Created(crate::v1_12::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/pod.rs b/src/v1_12/api/core/v1/pod.rs index bfef9b536d..9106c4968f 100644 --- a/src/v1_12/api/core/v1/pod.rs +++ b/src/v1_12/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1591,8 +1767,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_12::api::core::v1::Pod), Created(crate::v1_12::api::core::v1::Pod), Accepted(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1622,8 +1797,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1731,8 +1918,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1759,8 +1945,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1846,8 +2044,7 @@ pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Pod), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1882,8 +2079,20 @@ impl crate::Response for DeleteNamespacedPodResponse { }; Ok((DeleteNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1961,8 +2170,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_12::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1976,8 +2184,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2050,8 +2270,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2065,8 +2284,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2135,8 +2366,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2150,8 +2380,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2220,8 +2462,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2235,8 +2476,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2308,8 +2561,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2323,8 +2575,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2426,8 +2690,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -2451,8 +2714,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -2512,8 +2787,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -2527,8 +2801,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2598,8 +2884,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_12::api::core::v1::Pod), Created(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -2621,8 +2906,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2692,8 +2989,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_12::api::core::v1::Pod), Created(crate::v1_12::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -2715,8 +3011,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2787,8 +3095,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -2804,8 +3111,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2871,8 +3190,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -2888,8 +3206,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/pod_template.rs b/src/v1_12/api/core/v1/pod_template.rs index 9596bd9b50..487e173fb5 100644 --- a/src/v1_12/api/core/v1/pod_template.rs +++ b/src/v1_12/api/core/v1/pod_template.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_12::api::core::v1::PodTemplate), Created(crate::v1_12::api::core::v1::PodTemplate), Accepted(crate::v1_12::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::PodTemplate), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { }; Ok((DeleteNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_12::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_12::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_12::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_12::api::core::v1::PodTemplate), Created(crate::v1_12::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/replication_controller.rs b/src/v1_12/api/core/v1/replication_controller.rs index f57bc1a731..9899d3028e 100644 --- a/src/v1_12/api/core/v1/replication_controller.rs +++ b/src/v1_12/api/core/v1/replication_controller.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), Created(crate::v1_12::api::core::v1::ReplicationController), Accepted(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ReplicationController), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { }; Ok((DeleteNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_12::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), Created(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_12::api::core::v1::ReplicationController), Created(crate::v1_12::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/resource_quota.rs b/src/v1_12/api/core/v1/resource_quota.rs index ccbf56a390..3a1aa697bf 100644 --- a/src/v1_12/api/core/v1/resource_quota.rs +++ b/src/v1_12/api/core/v1/resource_quota.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), Created(crate::v1_12::api::core::v1::ResourceQuota), Accepted(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ResourceQuota), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { }; Ok((DeleteNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_12::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), Created(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_12::api::core::v1::ResourceQuota), Created(crate::v1_12::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/secret.rs b/src/v1_12/api/core/v1/secret.rs index 1e0a7b8298..bafd2420d0 100644 --- a/src/v1_12/api/core/v1/secret.rs +++ b/src/v1_12/api/core/v1/secret.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_12::api::core::v1::Secret), Created(crate::v1_12::api::core::v1::Secret), Accepted(crate::v1_12::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -225,8 +236,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -253,8 +263,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -340,8 +362,7 @@ pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Secret), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -376,8 +397,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { }; Ok((DeleteNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_12::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -544,8 +588,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -559,8 +602,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -629,8 +684,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_12::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -644,8 +698,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -717,8 +783,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_12::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -732,8 +797,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -803,8 +880,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_12::api::core::v1::Secret), Created(crate::v1_12::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -982,8 +1081,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -999,8 +1097,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/service.rs b/src/v1_12/api/core/v1/service.rs index 7c86d3ab2d..df9a396733 100644 --- a/src/v1_12/api/core/v1/service.rs +++ b/src/v1_12/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -967,8 +1077,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_12::api::core::v1::Service), Created(crate::v1_12::api::core::v1::Service), Accepted(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -998,8 +1107,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1085,8 +1206,7 @@ pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::Service), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1121,8 +1241,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { }; Ok((DeleteNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1200,8 +1332,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_12::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1215,8 +1346,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1289,8 +1432,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1304,8 +1446,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1374,8 +1528,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1389,8 +1542,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1459,8 +1624,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1474,8 +1638,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1547,8 +1723,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -1562,8 +1737,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1623,8 +1810,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -1638,8 +1824,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1709,8 +1907,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_12::api::core::v1::Service), Created(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -1732,8 +1929,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1803,8 +2012,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_12::api::core::v1::Service), Created(crate::v1_12::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -1826,8 +2034,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1898,8 +2118,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -1915,8 +2134,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1982,8 +2213,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -1999,8 +2229,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/core/v1/service_account.rs b/src/v1_12/api/core/v1/service_account.rs index e1393d8e00..37a54af7f3 100644 --- a/src/v1_12/api/core/v1/service_account.rs +++ b/src/v1_12/api/core/v1/service_account.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_12::api::core::v1::ServiceAccount), Created(crate::v1_12::api::core::v1::ServiceAccount), Accepted(crate::v1_12::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -225,8 +236,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -253,8 +263,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -340,8 +362,7 @@ pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::core::v1::ServiceAccount), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -376,8 +397,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { }; Ok((DeleteNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_12::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -544,8 +588,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_12::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -559,8 +602,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -629,8 +684,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_12::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -644,8 +698,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -717,8 +783,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_12::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -732,8 +797,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -803,8 +880,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_12::api::core::v1::ServiceAccount), Created(crate::v1_12::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -982,8 +1081,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -999,8 +1097,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/events/v1beta1/event.rs b/src/v1_12/api/events/v1beta1/event.rs index dcb808c203..44bf3cd397 100644 --- a/src/v1_12/api/events/v1beta1/event.rs +++ b/src/v1_12/api/events/v1beta1/event.rs @@ -117,8 +117,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_12::api::events::v1beta1::Event), Created(crate::v1_12::api::events::v1beta1::Event), Accepted(crate::v1_12::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -148,8 +147,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -257,8 +268,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -285,8 +295,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -372,8 +394,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::events::v1beta1::Event), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -408,8 +429,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -482,8 +515,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_12::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -497,8 +529,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -576,8 +620,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_12::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -591,8 +634,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -661,8 +716,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_12::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -676,8 +730,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -749,8 +815,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_12::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -764,8 +829,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -835,8 +912,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_12::api::events::v1beta1::Event), Created(crate::v1_12::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -858,8 +934,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -925,8 +1013,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -942,8 +1029,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1014,8 +1113,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1031,8 +1129,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/daemon_set.rs b/src/v1_12/api/extensions/v1beta1/daemon_set.rs index 9fd1fa4f93..06de058dcb 100644 --- a/src/v1_12/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_12/api/extensions/v1beta1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), Created(crate::v1_12::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), Created(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::DaemonSet), Created(crate::v1_12::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/deployment.rs b/src/v1_12/api/extensions/v1beta1/deployment.rs index 8b7ad2c88a..9b10584190 100644 --- a/src/v1_12/api/extensions/v1beta1/deployment.rs +++ b/src/v1_12/api/extensions/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), Created(crate::v1_12::api::extensions::v1beta1::Deployment), Accepted(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::Deployment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_12::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_12::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), Created(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Deployment), Created(crate::v1_12::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_12/api/extensions/v1beta1/deployment_rollback.rs index 13fce0b9ba..fdfc630331 100644 --- a/src/v1_12/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_12/api/extensions/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/ingress.rs b/src/v1_12/api/extensions/v1beta1/ingress.rs index 2a8117e097..7c373f632f 100644 --- a/src/v1_12/api/extensions/v1beta1/ingress.rs +++ b/src/v1_12/api/extensions/v1beta1/ingress.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), Created(crate::v1_12::api::extensions::v1beta1::Ingress), Accepted(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::Ingress), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { }; Ok((DeleteNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_12::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_12::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), Created(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::Ingress), Created(crate::v1_12::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/network_policy.rs b/src/v1_12/api/extensions/v1beta1/network_policy.rs index b17b64d60d..d126cd9053 100644 --- a/src/v1_12/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_12/api/extensions/v1beta1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_12::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_12/api/extensions/v1beta1/pod_security_policy.rs index 5663fc363d..3197aa0f6d 100644 --- a/src/v1_12/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_12/api/extensions/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_12::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/replica_set.rs b/src/v1_12/api/extensions/v1beta1/replica_set.rs index 13000d85b1..b12eed7f0c 100644 --- a/src/v1_12/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_12/api/extensions/v1beta1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_12::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_12::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_12::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/extensions/v1beta1/scale.rs b/src/v1_12/api/extensions/v1beta1/scale.rs index a6d46b483c..cc010cc39c 100644 --- a/src/v1_12/api/extensions/v1beta1/scale.rs +++ b/src/v1_12/api/extensions/v1beta1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -325,8 +358,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -340,8 +372,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -401,8 +445,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -416,8 +459,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -477,8 +532,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -492,8 +546,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -563,8 +629,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), Created(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -586,8 +651,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -657,8 +734,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), Created(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -680,8 +756,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -751,8 +839,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_12::api::extensions::v1beta1::Scale), Created(crate::v1_12::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -774,8 +861,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/networking/v1/network_policy.rs b/src/v1_12/api/networking/v1/network_policy.rs index d66be3cdda..93f5c746ad 100644 --- a/src/v1_12/api/networking/v1/network_policy.rs +++ b/src/v1_12/api/networking/v1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicy), Created(crate::v1_12::api::networking::v1::NetworkPolicy), Accepted(crate::v1_12::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::networking::v1::NetworkPolicy), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_12::api::networking::v1::NetworkPolicy), Created(crate::v1_12::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/policy/v1beta1/eviction.rs b/src/v1_12/api/policy/v1beta1/eviction.rs index 43a79b9fc1..7edcf6cc8c 100644 --- a/src/v1_12/api/policy/v1beta1/eviction.rs +++ b/src/v1_12/api/policy/v1beta1/eviction.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_12::api::policy::v1beta1::Eviction), Created(crate::v1_12::api::policy::v1beta1::Eviction), Accepted(crate::v1_12::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_12/api/policy/v1beta1/pod_disruption_budget.rs index dcd7301f72..12738821dd 100644 --- a/src/v1_12/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_12/api/policy/v1beta1/pod_disruption_budget.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -221,8 +232,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -249,8 +259,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -336,8 +358,7 @@ pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -372,8 +393,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { }; Ok((DeleteNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -451,8 +484,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -466,8 +498,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -540,8 +584,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -555,8 +598,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -625,8 +680,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -640,8 +694,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -710,8 +776,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -725,8 +790,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -798,8 +875,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -813,8 +889,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -874,8 +962,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -889,8 +976,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -960,8 +1059,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -983,8 +1081,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1054,8 +1164,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_12::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1077,8 +1186,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1149,8 +1270,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1166,8 +1286,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1233,8 +1365,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/policy/v1beta1/pod_security_policy.rs b/src/v1_12/api/policy/v1beta1/pod_security_policy.rs index 32591aa23b..cf5bc173b7 100644 --- a/src/v1_12/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_12/api/policy/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_12::api::policy::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_12::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1/cluster_role.rs b/src/v1_12/api/rbac/v1/cluster_role.rs index 024f0a3146..66afdf8a43 100644 --- a/src/v1_12/api/rbac/v1/cluster_role.rs +++ b/src/v1_12/api/rbac/v1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRole), Created(crate::v1_12::api::rbac::v1::ClusterRole), Accepted(crate::v1_12::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::ClusterRole), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRole), Created(crate::v1_12::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1/cluster_role_binding.rs b/src/v1_12/api/rbac/v1/cluster_role_binding.rs index 5a906c0815..872131682a 100644 --- a/src/v1_12/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_12/api/rbac/v1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_12::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1/role.rs b/src/v1_12/api/rbac/v1/role.rs index af715cc538..d945074e47 100644 --- a/src/v1_12/api/rbac/v1/role.rs +++ b/src/v1_12/api/rbac/v1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1::Role), Created(crate::v1_12::api::rbac::v1::Role), Accepted(crate::v1_12::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::Role), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1::Role), Created(crate::v1_12::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1/role_binding.rs b/src/v1_12/api/rbac/v1/role_binding.rs index b4c82ac61d..ffed4b7854 100644 --- a/src/v1_12/api/rbac/v1/role_binding.rs +++ b/src/v1_12/api/rbac/v1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::RoleBinding), Created(crate::v1_12::api::rbac::v1::RoleBinding), Accepted(crate::v1_12::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1::RoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1::RoleBinding), Created(crate::v1_12::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1alpha1/cluster_role.rs b/src/v1_12/api/rbac/v1alpha1/cluster_role.rs index d9ab637c08..0a6134edbb 100644 --- a/src/v1_12/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_12/api/rbac/v1alpha1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_12::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_12::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_12::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_12/api/rbac/v1alpha1/cluster_role_binding.rs index ed290791ae..8d78d34c72 100644 --- a/src/v1_12/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_12/api/rbac/v1alpha1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1alpha1/role.rs b/src/v1_12/api/rbac/v1alpha1/role.rs index 7dc6c505a8..791be9ce7d 100644 --- a/src/v1_12/api/rbac/v1alpha1/role.rs +++ b/src/v1_12/api/rbac/v1alpha1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::Role), Created(crate::v1_12::api::rbac::v1alpha1::Role), Accepted(crate::v1_12::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::Role), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1alpha1::Role), Created(crate::v1_12::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1alpha1/role_binding.rs b/src/v1_12/api/rbac/v1alpha1/role_binding.rs index 24884c0da0..8bf19e533a 100644 --- a/src/v1_12/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_12/api/rbac/v1alpha1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_12::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_12::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_12::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1beta1/cluster_role.rs b/src/v1_12/api/rbac/v1beta1/cluster_role.rs index 5eb715fede..73ccff9a42 100644 --- a/src/v1_12/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_12/api/rbac/v1beta1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRole), Created(crate::v1_12::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_12::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRole), Created(crate::v1_12::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_12/api/rbac/v1beta1/cluster_role_binding.rs index 70a959a0a5..a20a2ae1e8 100644 --- a/src/v1_12/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_12/api/rbac/v1beta1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_12::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1beta1/role.rs b/src/v1_12/api/rbac/v1beta1/role.rs index 7981f6e5b5..d731c38a81 100644 --- a/src/v1_12/api/rbac/v1beta1/role.rs +++ b/src/v1_12/api/rbac/v1beta1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::Role), Created(crate::v1_12::api::rbac::v1beta1::Role), Accepted(crate::v1_12::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::Role), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_12::api::rbac::v1beta1::Role), Created(crate::v1_12::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/rbac/v1beta1/role_binding.rs b/src/v1_12/api/rbac/v1beta1/role_binding.rs index 5082bde80b..d73b0979d8 100644 --- a/src/v1_12/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_12/api/rbac/v1beta1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBinding), Created(crate::v1_12::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_12::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_12::api::rbac::v1beta1::RoleBinding), Created(crate::v1_12::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/scheduling/v1alpha1/priority_class.rs b/src/v1_12/api/scheduling/v1alpha1/priority_class.rs index 2f79ca99e3..a04fa1e14a 100644 --- a/src/v1_12/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_12/api/scheduling/v1alpha1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -325,8 +347,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -361,8 +382,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -435,8 +468,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -450,8 +482,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -530,8 +573,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -598,8 +653,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -613,8 +667,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_12::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -769,8 +846,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -786,8 +862,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/scheduling/v1beta1/priority_class.rs b/src/v1_12/api/scheduling/v1beta1/priority_class.rs index 41e7fcfeb4..f3877e0459 100644 --- a/src/v1_12/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_12/api/scheduling/v1beta1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_12::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_12::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -325,8 +347,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -361,8 +382,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -435,8 +468,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1beta1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -450,8 +482,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -530,8 +573,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -598,8 +653,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -613,8 +667,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_12::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_12::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -769,8 +846,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -786,8 +862,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/settings/v1alpha1/pod_preset.rs b/src/v1_12/api/settings/v1alpha1/pod_preset.rs index bc66bbcefc..73d96b5fc5 100644 --- a/src/v1_12/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_12/api/settings/v1alpha1/pod_preset.rs @@ -77,8 +77,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPreset), Created(crate::v1_12::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_12::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -217,8 +228,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -245,8 +255,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -332,8 +354,7 @@ pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -368,8 +389,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { }; Ok((DeleteNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -536,8 +580,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -551,8 +594,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -795,8 +872,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_12::api::settings::v1alpha1::PodPreset), Created(crate::v1_12::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -818,8 +894,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -974,8 +1073,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -991,8 +1089,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/storage/v1/storage_class.rs b/src/v1_12/api/storage/v1/storage_class.rs index df996c16a6..0fd2e08f62 100644 --- a/src/v1_12/api/storage/v1/storage_class.rs +++ b/src/v1_12/api/storage/v1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_12::api::storage::v1::StorageClass), Created(crate::v1_12::api::storage::v1::StorageClass), Accepted(crate::v1_12::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -229,8 +240,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -257,8 +267,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1::StorageClass), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_12::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_12::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -544,8 +587,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -612,8 +667,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_12::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -627,8 +681,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -693,8 +759,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_12::api::storage::v1::StorageClass), Created(crate::v1_12::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -716,8 +781,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -783,8 +860,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -800,8 +876,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/storage/v1alpha1/volume_attachment.rs b/src/v1_12/api/storage/v1alpha1/volume_attachment.rs index e5eed0bf3a..49d92adb25 100644 --- a/src/v1_12/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_12/api/storage/v1alpha1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -214,8 +225,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -242,8 +252,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -360,8 +381,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -597,8 +652,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -612,8 +666,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -678,8 +744,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_12::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -701,8 +766,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -768,8 +845,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -785,8 +861,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/storage/v1beta1/storage_class.rs b/src/v1_12/api/storage/v1beta1/storage_class.rs index 7d36c49cd6..f0b74d1929 100644 --- a/src/v1_12/api/storage/v1beta1/storage_class.rs +++ b/src/v1_12/api/storage/v1beta1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_12::api::storage::v1beta1::StorageClass), Created(crate::v1_12::api::storage::v1beta1::StorageClass), Accepted(crate::v1_12::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -229,8 +240,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -257,8 +267,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1beta1::StorageClass), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_12::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_12::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -544,8 +587,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -612,8 +667,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_12::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -627,8 +681,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -693,8 +759,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_12::api::storage::v1beta1::StorageClass), Created(crate::v1_12::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -716,8 +781,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -783,8 +860,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -800,8 +876,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/api/storage/v1beta1/volume_attachment.rs b/src/v1_12/api/storage/v1beta1/volume_attachment.rs index eeade4b1a3..7b8408c264 100644 --- a/src/v1_12/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_12/api/storage/v1beta1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_12::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_12::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -214,8 +225,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -242,8 +252,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -360,8 +381,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1beta1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -597,8 +652,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -612,8 +666,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -678,8 +744,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_12::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_12::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -701,8 +766,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -768,8 +845,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -785,8 +861,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_12/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index 4fe24e1aa0..aa2ee36afc 100644 --- a/src/v1_12/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_12/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -76,8 +76,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -321,8 +343,7 @@ pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { }; Ok((DeleteCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionStatusResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchCustomResourceDefinitionStatusResponse { }; Ok((PatchCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionStatusResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadCustomResourceDefinitionStatusResponse { }; Ok((ReadCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_12::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 75ca025110..ac12eacd64 100644 --- a/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 64d76ab46e..a1d461dbe4 100644 --- a/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_12/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_12::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_12::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_12/mod.rs b/src/v1_12/mod.rs index e03ef5c9a1..ca363a458f 100644 --- a/src/v1_12/mod.rs +++ b/src/v1_12/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1APIResourcesResponse { }; Ok((GetApiregistrationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_autoscaling_v2beta2_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta2APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { }; Ok((GetAutoscalingV2beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_12::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_coordination_api_group( #[derive(Debug)] pub enum GetCoordinationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationAPIGroupResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetCoordinationAPIGroupResponse { }; Ok((GetCoordinationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_coordination_v1beta1_api_resources( #[derive(Debug)] pub enum GetCoordinationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { }; Ok((GetCoordinationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_scheduling_v1beta1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { }; Ok((GetSchedulingV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -2138,8 +2688,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -2153,8 +2702,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2180,8 +2741,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -2195,8 +2755,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2222,8 +2794,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2237,8 +2808,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2264,8 +2847,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2279,8 +2861,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2306,8 +2900,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_12::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2321,8 +2914,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2352,15 +2957,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2383,15 +2999,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_13/api/admissionregistration/v1alpha1/initializer_configuration.rs index 47253436d6..32e21b69b3 100644 --- a/src/v1_13/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_13/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { }; Ok((DeleteInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_13::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_13/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 13c1b913fe..045b1a9dfb 100644 --- a/src/v1_13/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_13/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { }; Ok((DeleteMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_13::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_13/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 26cd6dd978..a7d7ccf134 100644 --- a/src/v1_13/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_13/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { }; Ok((DeleteValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_13::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1/controller_revision.rs b/src/v1_13/api/apps/v1/controller_revision.rs index 355a619b04..8db8d4c0dc 100644 --- a/src/v1_13/api/apps/v1/controller_revision.rs +++ b/src/v1_13/api/apps/v1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevision), Created(crate::v1_13::api::apps::v1::ControllerRevision), Accepted(crate::v1_13::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::ControllerRevision), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1::ControllerRevision), Created(crate::v1_13::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1/daemon_set.rs b/src/v1_13/api/apps/v1/daemon_set.rs index 7fef7baee4..d4a148bc12 100644 --- a/src/v1_13/api/apps/v1/daemon_set.rs +++ b/src/v1_13/api/apps/v1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), Created(crate::v1_13::api::apps::v1::DaemonSet), Accepted(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::DaemonSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), Created(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1::DaemonSet), Created(crate::v1_13::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1/deployment.rs b/src/v1_13/api/apps/v1/deployment.rs index 290c6feecd..3a330a9517 100644 --- a/src/v1_13/api/apps/v1/deployment.rs +++ b/src/v1_13/api/apps/v1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1::Deployment), Created(crate::v1_13::api::apps::v1::Deployment), Accepted(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::Deployment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1::Deployment), Created(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1::Deployment), Created(crate::v1_13::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1/replica_set.rs b/src/v1_13/api/apps/v1/replica_set.rs index e27fdad4b1..bf0c1e1c62 100644 --- a/src/v1_13/api/apps/v1/replica_set.rs +++ b/src/v1_13/api/apps/v1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), Created(crate::v1_13::api::apps::v1::ReplicaSet), Accepted(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::ReplicaSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), Created(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1::ReplicaSet), Created(crate::v1_13::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1/stateful_set.rs b/src/v1_13/api/apps/v1/stateful_set.rs index 5b3450555a..30371741e8 100644 --- a/src/v1_13/api/apps/v1/stateful_set.rs +++ b/src/v1_13/api/apps/v1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), Created(crate::v1_13::api::apps::v1::StatefulSet), Accepted(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1::StatefulSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), Created(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1::StatefulSet), Created(crate::v1_13::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta1/controller_revision.rs b/src/v1_13/api/apps/v1beta1/controller_revision.rs index 6811529b46..7c8495c45a 100644 --- a/src/v1_13/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_13/api/apps/v1beta1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevision), Created(crate::v1_13::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_13::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta1::ControllerRevision), Created(crate::v1_13::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta1/deployment.rs b/src/v1_13/api/apps/v1beta1/deployment.rs index 813426f82a..b12b6059a3 100644 --- a/src/v1_13/api/apps/v1beta1/deployment.rs +++ b/src/v1_13/api/apps/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), Created(crate::v1_13::api::apps::v1beta1::Deployment), Accepted(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::Deployment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), Created(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::Deployment), Created(crate::v1_13::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta1/deployment_rollback.rs b/src/v1_13/api/apps/v1beta1/deployment_rollback.rs index 089933a1c4..7fd1e45849 100644 --- a/src/v1_13/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_13/api/apps/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta1/scale.rs b/src/v1_13/api/apps/v1beta1/scale.rs index eb2229269c..fa973c689b 100644 --- a/src/v1_13/api/apps/v1beta1/scale.rs +++ b/src/v1_13/api/apps/v1beta1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -240,8 +262,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -255,8 +276,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -316,8 +349,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -331,8 +363,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -402,8 +446,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), Created(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -425,8 +468,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -496,8 +551,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta1::Scale), Created(crate::v1_13::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -519,8 +573,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta1/stateful_set.rs b/src/v1_13/api/apps/v1beta1/stateful_set.rs index d7e3417b71..873aa3c54a 100644 --- a/src/v1_13/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_13/api/apps/v1beta1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), Created(crate::v1_13::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), Created(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta1::StatefulSet), Created(crate::v1_13::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/controller_revision.rs b/src/v1_13/api/apps/v1beta2/controller_revision.rs index 49f939ba4a..d001522059 100644 --- a/src/v1_13/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_13/api/apps/v1beta2/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevision), Created(crate::v1_13::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_13::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_13::api::apps::v1beta2::ControllerRevision), Created(crate::v1_13::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/daemon_set.rs b/src/v1_13/api/apps/v1beta2/daemon_set.rs index 0a93bf2d7d..cb212cc88e 100644 --- a/src/v1_13/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_13/api/apps/v1beta2/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), Created(crate::v1_13::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), Created(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::DaemonSet), Created(crate::v1_13::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/deployment.rs b/src/v1_13/api/apps/v1beta2/deployment.rs index cef4dab28f..fa68e39e45 100644 --- a/src/v1_13/api/apps/v1beta2/deployment.rs +++ b/src/v1_13/api/apps/v1beta2/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), Created(crate::v1_13::api::apps::v1beta2::Deployment), Accepted(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::Deployment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), Created(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::Deployment), Created(crate::v1_13::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/replica_set.rs b/src/v1_13/api/apps/v1beta2/replica_set.rs index 65782f81ed..a4b8781c61 100644 --- a/src/v1_13/api/apps/v1beta2/replica_set.rs +++ b/src/v1_13/api/apps/v1beta2/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), Created(crate::v1_13::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), Created(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::ReplicaSet), Created(crate::v1_13::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/scale.rs b/src/v1_13/api/apps/v1beta2/scale.rs index 10b976ae4b..8574765a7e 100644 --- a/src/v1_13/api/apps/v1beta2/scale.rs +++ b/src/v1_13/api/apps/v1beta2/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -325,8 +358,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -340,8 +372,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -401,8 +445,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -416,8 +459,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -477,8 +532,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -492,8 +546,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -563,8 +629,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), Created(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -586,8 +651,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -657,8 +734,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), Created(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -680,8 +756,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -751,8 +839,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::apps::v1beta2::Scale), Created(crate::v1_13::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -774,8 +861,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/apps/v1beta2/stateful_set.rs b/src/v1_13/api/apps/v1beta2/stateful_set.rs index 8faa047857..b67c0fc415 100644 --- a/src/v1_13/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_13/api/apps/v1beta2/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), Created(crate::v1_13::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -543,8 +587,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -558,8 +601,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -628,8 +683,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -643,8 +697,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -713,8 +779,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -728,8 +793,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -816,8 +892,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -877,8 +965,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -892,8 +979,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), Created(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -986,8 +1084,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1057,8 +1167,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_13::api::apps::v1beta2::StatefulSet), Created(crate::v1_13::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1080,8 +1189,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1152,8 +1273,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1169,8 +1289,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1236,8 +1368,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1253,8 +1384,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/auditregistration/v1alpha1/audit_sink.rs b/src/v1_13/api/auditregistration/v1alpha1/audit_sink.rs index b1d3abf7d6..b0f2497732 100644 --- a/src/v1_13/api/auditregistration/v1alpha1/audit_sink.rs +++ b/src/v1_13/api/auditregistration/v1alpha1/audit_sink.rs @@ -73,8 +73,7 @@ pub enum CreateAuditSinkResponse { Ok(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), Created(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), Accepted(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAuditSinkResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateAuditSinkResponse { }; Ok((CreateAuditSinkResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAuditSinkResponse::Unauthorized, 0)), - _ => Ok((CreateAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAuditSinkResponse::Other(result), read)) + }, } } } @@ -186,8 +197,7 @@ pub enum DeleteAuditSinkResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAuditSinkResponse { @@ -222,8 +232,20 @@ impl crate::Response for DeleteAuditSinkResponse { }; Ok((DeleteAuditSinkResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAuditSinkResponse::Unauthorized, 0)), - _ => Ok((DeleteAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAuditSinkResponse::Other(result), read)) + }, } } } @@ -326,8 +348,7 @@ pub struct DeleteCollectionAuditSinkOptional<'a> { pub enum DeleteCollectionAuditSinkResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAuditSinkResponse { @@ -354,8 +375,20 @@ impl crate::Response for DeleteCollectionAuditSinkResponse { Ok((DeleteCollectionAuditSinkResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAuditSinkResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAuditSinkResponse::Other(result), read)) + }, } } } @@ -428,8 +461,7 @@ impl AuditSink { #[derive(Debug)] pub enum ListAuditSinkResponse { Ok(crate::v1_13::api::auditregistration::v1alpha1::AuditSinkList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAuditSinkResponse { @@ -443,8 +475,20 @@ impl crate::Response for ListAuditSinkResponse { }; Ok((ListAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ListAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAuditSinkResponse::Other(result), read)) + }, } } } @@ -508,8 +552,7 @@ pub struct PatchAuditSinkOptional<'a> { #[derive(Debug)] pub enum PatchAuditSinkResponse { Ok(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAuditSinkResponse { @@ -523,8 +566,20 @@ impl crate::Response for PatchAuditSinkResponse { }; Ok((PatchAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAuditSinkResponse::Unauthorized, 0)), - _ => Ok((PatchAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAuditSinkResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct ReadAuditSinkOptional<'a> { #[derive(Debug)] pub enum ReadAuditSinkResponse { Ok(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAuditSinkResponse { @@ -606,8 +660,20 @@ impl crate::Response for ReadAuditSinkResponse { }; Ok((ReadAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ReadAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAuditSinkResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceAuditSinkOptional<'a> { pub enum ReplaceAuditSinkResponse { Ok(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), Created(crate::v1_13::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAuditSinkResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceAuditSinkResponse { }; Ok((ReplaceAuditSinkResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ReplaceAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAuditSinkResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ impl AuditSink { #[derive(Debug)] pub enum WatchAuditSinkResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAuditSinkResponse { @@ -779,8 +855,20 @@ impl crate::Response for WatchAuditSinkResponse { }; Ok((WatchAuditSinkResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAuditSinkResponse::Unauthorized, 0)), - _ => Ok((WatchAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAuditSinkResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authentication/v1/token_review.rs b/src/v1_13/api/authentication/v1/token_review.rs index b66c633e0a..de3d6ec55a 100644 --- a/src/v1_13/api/authentication/v1/token_review.rs +++ b/src/v1_13/api/authentication/v1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_13::api::authentication::v1::TokenReview), Created(crate::v1_13::api::authentication::v1::TokenReview), Accepted(crate::v1_13::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authentication/v1beta1/token_review.rs b/src/v1_13/api/authentication/v1beta1/token_review.rs index 52e7de1740..f9d1143ce8 100644 --- a/src/v1_13/api/authentication/v1beta1/token_review.rs +++ b/src/v1_13/api/authentication/v1beta1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_13::api::authentication::v1beta1::TokenReview), Created(crate::v1_13::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_13::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1/local_subject_access_review.rs b/src/v1_13/api/authorization/v1/local_subject_access_review.rs index f22c349768..3ade77e79f 100644 --- a/src/v1_13/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_13/api/authorization/v1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_13::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1/self_subject_access_review.rs b/src/v1_13/api/authorization/v1/self_subject_access_review.rs index ac36de1ab3..9ffe2babb6 100644 --- a/src/v1_13/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_13/api/authorization/v1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_13::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1/self_subject_rules_review.rs b/src/v1_13/api/authorization/v1/self_subject_rules_review.rs index 9730413701..2f817b4a12 100644 --- a/src/v1_13/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_13/api/authorization/v1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_13::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_13::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_13::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1/subject_access_review.rs b/src/v1_13/api/authorization/v1/subject_access_review.rs index b2ef4c9d3a..f333ec12ca 100644 --- a/src/v1_13/api/authorization/v1/subject_access_review.rs +++ b/src/v1_13/api/authorization/v1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1::SubjectAccessReview), Created(crate::v1_13::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_13/api/authorization/v1beta1/local_subject_access_review.rs index ca04fe1e1e..1accdd988b 100644 --- a/src/v1_13/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_13/api/authorization/v1beta1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_13::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_13/api/authorization/v1beta1/self_subject_access_review.rs index 27e45eb3ff..160855638b 100644 --- a/src/v1_13/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_13/api/authorization/v1beta1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_13::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_13/api/authorization/v1beta1/self_subject_rules_review.rs index a2e5529b63..4a7f3bd796 100644 --- a/src/v1_13/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_13/api/authorization/v1beta1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_13::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_13::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_13::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/authorization/v1beta1/subject_access_review.rs b/src/v1_13/api/authorization/v1beta1/subject_access_review.rs index 750cd0f4b1..e15dd397c5 100644 --- a/src/v1_13/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_13/api/authorization/v1beta1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_13::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_13::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_13::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_13/api/autoscaling/v1/horizontal_pod_autoscaler.rs index 98d1859369..f4f496caa4 100644 --- a/src/v1_13/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_13/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/autoscaling/v1/scale.rs b/src/v1_13/api/autoscaling/v1/scale.rs index 413fde8b35..87fbf564c8 100644 --- a/src/v1_13/api/autoscaling/v1/scale.rs +++ b/src/v1_13/api/autoscaling/v1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -334,8 +367,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -349,8 +381,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -410,8 +454,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -425,8 +468,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -486,8 +541,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -501,8 +555,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -562,8 +628,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -577,8 +642,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -638,8 +715,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -653,8 +729,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -724,8 +812,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), Created(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -747,8 +834,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -818,8 +917,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), Created(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -841,8 +939,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -912,8 +1022,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), Created(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -935,8 +1044,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -1006,8 +1127,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_13::api::autoscaling::v1::Scale), Created(crate::v1_13::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -1029,8 +1149,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_13/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index 4963c68e82..f9c34946a3 100644 --- a/src/v1_13/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_13/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs b/src/v1_13/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs index d63f6b929c..91228b2b65 100644 --- a/src/v1_13/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs +++ b/src/v1_13/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_13::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/batch/v1/job.rs b/src/v1_13/api/batch/v1/job.rs index 43335062e1..c1044bfb05 100644 --- a/src/v1_13/api/batch/v1/job.rs +++ b/src/v1_13/api/batch/v1/job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_13::api::batch::v1::Job), Created(crate::v1_13::api::batch::v1::Job), Accepted(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v1::Job), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedJobResponse { }; Ok((DeleteNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_13::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_13::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_13::api::batch::v1::Job), Created(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_13::api::batch::v1::Job), Created(crate::v1_13::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/batch/v1beta1/cron_job.rs b/src/v1_13/api/batch/v1beta1/cron_job.rs index f38f195c32..3187312777 100644 --- a/src/v1_13/api/batch/v1beta1/cron_job.rs +++ b/src/v1_13/api/batch/v1beta1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), Created(crate::v1_13::api::batch::v1beta1::CronJob), Accepted(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v1beta1::CronJob), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), Created(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v1beta1::CronJob), Created(crate::v1_13::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/batch/v2alpha1/cron_job.rs b/src/v1_13/api/batch/v2alpha1/cron_job.rs index 4596bafa24..0257ecb97d 100644 --- a/src/v1_13/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_13/api/batch/v2alpha1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), Created(crate::v1_13::api::batch::v2alpha1::CronJob), Accepted(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::batch::v2alpha1::CronJob), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), Created(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_13::api::batch::v2alpha1::CronJob), Created(crate::v1_13::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_13/api/certificates/v1beta1/certificate_signing_request.rs index b1130bb3ce..e9f1082da2 100644 --- a/src/v1_13/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_13/api/certificates/v1beta1/certificate_signing_request.rs @@ -76,8 +76,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { }; Ok((DeleteCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestStatusResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchCertificateSigningRequestStatusResponse { }; Ok((PatchCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestStatusResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadCertificateSigningRequestStatusResponse { }; Ok((ReadCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_13::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -1094,8 +1215,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -1111,8 +1231,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/coordination/v1beta1/lease.rs b/src/v1_13/api/coordination/v1beta1/lease.rs index 212ba50376..b8b5b2af2f 100644 --- a/src/v1_13/api/coordination/v1beta1/lease.rs +++ b/src/v1_13/api/coordination/v1beta1/lease.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLeaseResponse { Ok(crate::v1_13::api::coordination::v1beta1::Lease), Created(crate::v1_13::api::coordination::v1beta1::Lease), Accepted(crate::v1_13::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLeaseResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLeaseResponse { }; Ok((CreateNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedLeaseOptional<'a> { pub enum DeleteCollectionNamespacedLeaseResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLeaseResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedLeaseResponse { Ok((DeleteCollectionNamespacedLeaseResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedLeaseResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::coordination::v1beta1::Lease), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLeaseResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedLeaseResponse { }; Ok((DeleteNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl Lease { #[derive(Debug)] pub enum ListLeaseForAllNamespacesResponse { Ok(crate::v1_13::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLeaseForAllNamespacesResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListLeaseForAllNamespacesResponse { }; Ok((ListLeaseForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Lease { #[derive(Debug)] pub enum ListNamespacedLeaseResponse { Ok(crate::v1_13::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLeaseResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNamespacedLeaseResponse { }; Ok((ListNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLeaseResponse { Ok(crate::v1_13::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLeaseResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedLeaseResponse { }; Ok((PatchNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLeaseResponse { Ok(crate::v1_13::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLeaseResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedLeaseResponse { }; Ok((ReadNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedLeaseOptional<'a> { pub enum ReplaceNamespacedLeaseResponse { Ok(crate::v1_13::api::coordination::v1beta1::Lease), Created(crate::v1_13::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLeaseResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedLeaseResponse { }; Ok((ReplaceNamespacedLeaseResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl Lease { #[derive(Debug)] pub enum WatchLeaseForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLeaseForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLeaseForAllNamespacesResponse { }; Ok((WatchLeaseForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl Lease { #[derive(Debug)] pub enum WatchNamespacedLeaseResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLeaseResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNamespacedLeaseResponse { }; Ok((WatchNamespacedLeaseResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLeaseResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/binding.rs b/src/v1_13/api/core/v1/binding.rs index 9f08802cf7..11e44dc186 100644 --- a/src/v1_13/api/core/v1/binding.rs +++ b/src/v1_13/api/core/v1/binding.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_13::api::core::v1::Binding), Created(crate::v1_13::api::core::v1::Binding), Accepted(crate::v1_13::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_13::api::core::v1::Binding), Created(crate::v1_13::api::core::v1::Binding), Accepted(crate::v1_13::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -219,8 +229,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/component_status.rs b/src/v1_13/api/core/v1/component_status.rs index f9028b00c2..b0461b7bf9 100644 --- a/src/v1_13/api/core/v1/component_status.rs +++ b/src/v1_13/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_13::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_13::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/config_map.rs b/src/v1_13/api/core/v1/config_map.rs index 90ae199bbd..251b669b4b 100644 --- a/src/v1_13/api/core/v1/config_map.rs +++ b/src/v1_13/api/core/v1/config_map.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_13::api::core::v1::ConfigMap), Created(crate::v1_13::api::core::v1::ConfigMap), Accepted(crate::v1_13::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ConfigMap), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { }; Ok((DeleteNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_13::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_13::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_13::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -800,8 +877,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_13::api::core::v1::ConfigMap), Created(crate::v1_13::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -996,8 +1094,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/endpoints.rs b/src/v1_13/api/core/v1/endpoints.rs index 4374fdff2d..2ec6f5c6e5 100644 --- a/src/v1_13/api/core/v1/endpoints.rs +++ b/src/v1_13/api/core/v1/endpoints.rs @@ -90,8 +90,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_13::api::core::v1::Endpoints), Created(crate::v1_13::api::core::v1::Endpoints), Accepted(crate::v1_13::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -121,8 +120,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -230,8 +241,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -258,8 +268,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -345,8 +367,7 @@ pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Endpoints), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -381,8 +402,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { }; Ok((DeleteNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -549,8 +593,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_13::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -564,8 +607,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -634,8 +689,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_13::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -649,8 +703,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -722,8 +788,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_13::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -737,8 +802,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -808,8 +885,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_13::api::core::v1::Endpoints), Created(crate::v1_13::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -831,8 +907,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -987,8 +1086,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -1004,8 +1102,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/event.rs b/src/v1_13/api/core/v1/event.rs index 3db473a792..26feda6fd6 100644 --- a/src/v1_13/api/core/v1/event.rs +++ b/src/v1_13/api/core/v1/event.rs @@ -118,8 +118,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_13::api::core::v1::Event), Created(crate::v1_13::api::core::v1::Event), Accepted(crate::v1_13::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -149,8 +148,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -258,8 +269,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -286,8 +296,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -373,8 +395,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Event), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -409,8 +430,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -483,8 +516,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -498,8 +530,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -577,8 +621,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_13::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -592,8 +635,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -662,8 +717,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_13::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -677,8 +731,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -750,8 +816,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_13::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -765,8 +830,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -836,8 +913,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_13::api::core::v1::Event), Created(crate::v1_13::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -859,8 +935,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -926,8 +1014,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -943,8 +1030,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1015,8 +1114,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1032,8 +1130,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/limit_range.rs b/src/v1_13/api/core/v1/limit_range.rs index ed52ab1bed..3164615c3f 100644 --- a/src/v1_13/api/core/v1/limit_range.rs +++ b/src/v1_13/api/core/v1/limit_range.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_13::api::core::v1::LimitRange), Created(crate::v1_13::api::core::v1::LimitRange), Accepted(crate::v1_13::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::LimitRange), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { }; Ok((DeleteNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_13::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_13::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_13::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_13::api::core::v1::LimitRange), Created(crate::v1_13::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/namespace.rs b/src/v1_13/api/core/v1/namespace.rs index c99cbbe5b6..ead60f784b 100644 --- a/src/v1_13/api/core/v1/namespace.rs +++ b/src/v1_13/api/core/v1/namespace.rs @@ -77,8 +77,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_13::api::core::v1::Namespace), Created(crate::v1_13::api::core::v1::Namespace), Accepted(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteNamespaceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Namespace), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteNamespaceResponse { }; Ok((DeleteNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_13::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -315,8 +336,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -380,8 +413,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -395,8 +427,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -460,8 +504,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -475,8 +518,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -543,8 +598,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -558,8 +612,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -614,8 +680,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -629,8 +694,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -695,8 +772,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_13::api::core::v1::Namespace), Created(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -718,8 +794,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -784,8 +872,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_13::api::core::v1::Namespace), Created(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -807,8 +894,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -873,8 +972,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_13::api::core::v1::Namespace), Created(crate::v1_13::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -896,8 +994,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -963,8 +1073,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -980,8 +1089,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/node.rs b/src/v1_13/api/core/v1/node.rs index 2ce916e629..9b6e061ea7 100644 --- a/src/v1_13/api/core/v1/node.rs +++ b/src/v1_13/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -912,8 +1022,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_13::api::core::v1::Node), Created(crate::v1_13::api::core::v1::Node), Accepted(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -943,8 +1052,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1047,8 +1168,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1075,8 +1195,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1157,8 +1289,7 @@ pub enum DeleteNodeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Node), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1193,8 +1324,20 @@ impl crate::Response for DeleteNodeResponse { }; Ok((DeleteNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1267,8 +1410,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_13::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1282,8 +1424,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1347,8 +1501,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1362,8 +1515,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1427,8 +1592,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1442,8 +1606,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1510,8 +1686,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -1525,8 +1700,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -1581,8 +1768,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -1596,8 +1782,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -1662,8 +1860,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_13::api::core::v1::Node), Created(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -1685,8 +1882,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -1751,8 +1960,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_13::api::core::v1::Node), Created(crate::v1_13::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -1774,8 +1982,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -1841,8 +2061,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -1858,8 +2077,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/persistent_volume.rs b/src/v1_13/api/core/v1/persistent_volume.rs index 1eac6ee960..d914b108b6 100644 --- a/src/v1_13/api/core/v1/persistent_volume.rs +++ b/src/v1_13/api/core/v1/persistent_volume.rs @@ -77,8 +77,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), Created(crate::v1_13::api::core::v1::PersistentVolume), Accepted(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -322,8 +344,7 @@ pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PersistentVolume), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeletePersistentVolumeResponse { }; Ok((DeletePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -607,8 +661,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -675,8 +741,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -690,8 +755,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -746,8 +823,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -761,8 +837,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), Created(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -850,8 +937,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolume), Created(crate::v1_13::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -1006,8 +1116,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -1023,8 +1132,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/persistent_volume_claim.rs b/src/v1_13/api/core/v1/persistent_volume_claim.rs index 64466c1558..5e1b7324f8 100644 --- a/src/v1_13/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_13/api/core/v1/persistent_volume_claim.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), Created(crate::v1_13::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { }; Ok((DeleteNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), Created(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_13::api::core::v1::PersistentVolumeClaim), Created(crate::v1_13::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/pod.rs b/src/v1_13/api/core/v1/pod.rs index 304bdb5a7e..37c0c383ed 100644 --- a/src/v1_13/api/core/v1/pod.rs +++ b/src/v1_13/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1591,8 +1767,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_13::api::core::v1::Pod), Created(crate::v1_13::api::core::v1::Pod), Accepted(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1622,8 +1797,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1731,8 +1918,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1759,8 +1945,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1846,8 +2044,7 @@ pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Pod), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1882,8 +2079,20 @@ impl crate::Response for DeleteNamespacedPodResponse { }; Ok((DeleteNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1961,8 +2170,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_13::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1976,8 +2184,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2050,8 +2270,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2065,8 +2284,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2135,8 +2366,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2150,8 +2380,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2220,8 +2462,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2235,8 +2476,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2308,8 +2561,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2323,8 +2575,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2426,8 +2690,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -2451,8 +2714,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -2512,8 +2787,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -2527,8 +2801,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2598,8 +2884,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_13::api::core::v1::Pod), Created(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -2621,8 +2906,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2692,8 +2989,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_13::api::core::v1::Pod), Created(crate::v1_13::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -2715,8 +3011,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2787,8 +3095,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -2804,8 +3111,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2871,8 +3190,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -2888,8 +3206,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/pod_template.rs b/src/v1_13/api/core/v1/pod_template.rs index 66d08eb850..3689f255d8 100644 --- a/src/v1_13/api/core/v1/pod_template.rs +++ b/src/v1_13/api/core/v1/pod_template.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_13::api::core::v1::PodTemplate), Created(crate::v1_13::api::core::v1::PodTemplate), Accepted(crate::v1_13::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::PodTemplate), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { }; Ok((DeleteNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_13::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_13::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_13::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_13::api::core::v1::PodTemplate), Created(crate::v1_13::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/replication_controller.rs b/src/v1_13/api/core/v1/replication_controller.rs index d78c305796..54e7aaad56 100644 --- a/src/v1_13/api/core/v1/replication_controller.rs +++ b/src/v1_13/api/core/v1/replication_controller.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), Created(crate::v1_13::api::core::v1::ReplicationController), Accepted(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ReplicationController), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { }; Ok((DeleteNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_13::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), Created(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_13::api::core::v1::ReplicationController), Created(crate::v1_13::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/resource_quota.rs b/src/v1_13/api/core/v1/resource_quota.rs index d00134a6e3..95554ebf64 100644 --- a/src/v1_13/api/core/v1/resource_quota.rs +++ b/src/v1_13/api/core/v1/resource_quota.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), Created(crate::v1_13::api::core::v1::ResourceQuota), Accepted(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ResourceQuota), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { }; Ok((DeleteNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_13::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), Created(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_13::api::core::v1::ResourceQuota), Created(crate::v1_13::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/secret.rs b/src/v1_13/api/core/v1/secret.rs index 1e0f3b0569..7d213d5b18 100644 --- a/src/v1_13/api/core/v1/secret.rs +++ b/src/v1_13/api/core/v1/secret.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_13::api::core::v1::Secret), Created(crate::v1_13::api::core::v1::Secret), Accepted(crate::v1_13::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -225,8 +236,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -253,8 +263,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -340,8 +362,7 @@ pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Secret), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -376,8 +397,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { }; Ok((DeleteNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_13::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -544,8 +588,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -559,8 +602,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -629,8 +684,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_13::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -644,8 +698,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -717,8 +783,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_13::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -732,8 +797,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -803,8 +880,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_13::api::core::v1::Secret), Created(crate::v1_13::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -982,8 +1081,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -999,8 +1097,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/service.rs b/src/v1_13/api/core/v1/service.rs index fd3451d445..ba30f77166 100644 --- a/src/v1_13/api/core/v1/service.rs +++ b/src/v1_13/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -967,8 +1077,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_13::api::core::v1::Service), Created(crate::v1_13::api::core::v1::Service), Accepted(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -998,8 +1107,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1085,8 +1206,7 @@ pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::Service), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1121,8 +1241,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { }; Ok((DeleteNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1200,8 +1332,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_13::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1215,8 +1346,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1289,8 +1432,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1304,8 +1446,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1374,8 +1528,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1389,8 +1542,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1459,8 +1624,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1474,8 +1638,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1547,8 +1723,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -1562,8 +1737,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1623,8 +1810,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -1638,8 +1824,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1709,8 +1907,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_13::api::core::v1::Service), Created(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -1732,8 +1929,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1803,8 +2012,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_13::api::core::v1::Service), Created(crate::v1_13::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -1826,8 +2034,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1898,8 +2118,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -1915,8 +2134,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1982,8 +2213,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -1999,8 +2229,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/core/v1/service_account.rs b/src/v1_13/api/core/v1/service_account.rs index 32b3450dc6..e67bfd9a96 100644 --- a/src/v1_13/api/core/v1/service_account.rs +++ b/src/v1_13/api/core/v1/service_account.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_13::api::core::v1::ServiceAccount), Created(crate::v1_13::api::core::v1::ServiceAccount), Accepted(crate::v1_13::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -225,8 +236,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -253,8 +263,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -340,8 +362,7 @@ pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::core::v1::ServiceAccount), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -376,8 +397,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { }; Ok((DeleteNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -455,8 +488,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_13::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -470,8 +502,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -544,8 +588,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_13::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -559,8 +602,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -629,8 +684,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_13::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -644,8 +698,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -717,8 +783,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_13::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -732,8 +797,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -803,8 +880,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_13::api::core::v1::ServiceAccount), Created(crate::v1_13::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -982,8 +1081,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -999,8 +1097,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/events/v1beta1/event.rs b/src/v1_13/api/events/v1beta1/event.rs index ad861d8d35..ecab6e1a36 100644 --- a/src/v1_13/api/events/v1beta1/event.rs +++ b/src/v1_13/api/events/v1beta1/event.rs @@ -117,8 +117,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_13::api::events::v1beta1::Event), Created(crate::v1_13::api::events::v1beta1::Event), Accepted(crate::v1_13::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -148,8 +147,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -257,8 +268,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -285,8 +295,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -372,8 +394,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::events::v1beta1::Event), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -408,8 +429,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -482,8 +515,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_13::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -497,8 +529,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -576,8 +620,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_13::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -591,8 +634,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -661,8 +716,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_13::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -676,8 +730,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -749,8 +815,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_13::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -764,8 +829,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -835,8 +912,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_13::api::events::v1beta1::Event), Created(crate::v1_13::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -858,8 +934,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -925,8 +1013,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -942,8 +1029,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1014,8 +1113,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1031,8 +1129,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/daemon_set.rs b/src/v1_13/api/extensions/v1beta1/daemon_set.rs index 399bd69093..e1b621c9e2 100644 --- a/src/v1_13/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_13/api/extensions/v1beta1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), Created(crate::v1_13::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), Created(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::DaemonSet), Created(crate::v1_13::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/deployment.rs b/src/v1_13/api/extensions/v1beta1/deployment.rs index ea6f20ce3c..70cb9ccaa6 100644 --- a/src/v1_13/api/extensions/v1beta1/deployment.rs +++ b/src/v1_13/api/extensions/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), Created(crate::v1_13::api::extensions::v1beta1::Deployment), Accepted(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::Deployment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_13::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_13::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), Created(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Deployment), Created(crate::v1_13::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_13/api/extensions/v1beta1/deployment_rollback.rs index db4775a535..ab3a8e19ac 100644 --- a/src/v1_13/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_13/api/extensions/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/ingress.rs b/src/v1_13/api/extensions/v1beta1/ingress.rs index 090c83d712..7ba584e73d 100644 --- a/src/v1_13/api/extensions/v1beta1/ingress.rs +++ b/src/v1_13/api/extensions/v1beta1/ingress.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), Created(crate::v1_13::api::extensions::v1beta1::Ingress), Accepted(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::Ingress), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { }; Ok((DeleteNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_13::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_13::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), Created(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::Ingress), Created(crate::v1_13::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1145,8 +1266,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1162,8 +1282,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/network_policy.rs b/src/v1_13/api/extensions/v1beta1/network_policy.rs index 2b90d8dbb9..e20baa5e33 100644 --- a/src/v1_13/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_13/api/extensions/v1beta1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_13::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_13/api/extensions/v1beta1/pod_security_policy.rs index 2e4a960ae4..b3ce92d4d3 100644 --- a/src/v1_13/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_13/api/extensions/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_13::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/replica_set.rs b/src/v1_13/api/extensions/v1beta1/replica_set.rs index 0184787d06..7fbdd3aecd 100644 --- a/src/v1_13/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_13/api/extensions/v1beta1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_13::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -726,8 +791,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -814,8 +890,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -875,8 +963,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -890,8 +977,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -961,8 +1060,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -984,8 +1082,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1055,8 +1165,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_13::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_13::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1150,8 +1271,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1167,8 +1287,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1234,8 +1366,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1251,8 +1382,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/extensions/v1beta1/scale.rs b/src/v1_13/api/extensions/v1beta1/scale.rs index ff56f124f7..759cff2cad 100644 --- a/src/v1_13/api/extensions/v1beta1/scale.rs +++ b/src/v1_13/api/extensions/v1beta1/scale.rs @@ -79,8 +79,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -94,8 +93,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -179,8 +189,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -249,8 +271,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -264,8 +285,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -325,8 +358,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -340,8 +372,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -401,8 +445,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -416,8 +459,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -477,8 +532,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -492,8 +546,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -563,8 +629,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), Created(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -586,8 +651,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -657,8 +734,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), Created(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -680,8 +756,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -751,8 +839,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_13::api::extensions::v1beta1::Scale), Created(crate::v1_13::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -774,8 +861,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/networking/v1/network_policy.rs b/src/v1_13/api/networking/v1/network_policy.rs index 78db1cf841..4f053ccd7e 100644 --- a/src/v1_13/api/networking/v1/network_policy.rs +++ b/src/v1_13/api/networking/v1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicy), Created(crate::v1_13::api::networking::v1::NetworkPolicy), Accepted(crate::v1_13::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::networking::v1::NetworkPolicy), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -711,8 +777,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -726,8 +791,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -797,8 +874,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_13::api::networking::v1::NetworkPolicy), Created(crate::v1_13::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -820,8 +896,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -993,8 +1091,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/policy/v1beta1/eviction.rs b/src/v1_13/api/policy/v1beta1/eviction.rs index 2ee43ddcbe..f24cf879ac 100644 --- a/src/v1_13/api/policy/v1beta1/eviction.rs +++ b/src/v1_13/api/policy/v1beta1/eviction.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_13::api::policy::v1beta1::Eviction), Created(crate::v1_13::api::policy::v1beta1::Eviction), Accepted(crate::v1_13::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_13/api/policy/v1beta1/pod_disruption_budget.rs index ebf2c954eb..f320913934 100644 --- a/src/v1_13/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_13/api/policy/v1beta1/pod_disruption_budget.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -221,8 +232,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -249,8 +259,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -336,8 +358,7 @@ pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -372,8 +393,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { }; Ok((DeleteNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -451,8 +484,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -466,8 +498,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -540,8 +584,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -555,8 +598,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -625,8 +680,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -640,8 +694,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -710,8 +776,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -725,8 +790,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -798,8 +875,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -813,8 +889,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -874,8 +962,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -889,8 +976,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -960,8 +1059,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -983,8 +1081,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1054,8 +1164,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_13::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1077,8 +1186,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1149,8 +1270,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1166,8 +1286,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1233,8 +1365,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/policy/v1beta1/pod_security_policy.rs b/src/v1_13/api/policy/v1beta1/pod_security_policy.rs index 4db87f754d..2c13bcf4e0 100644 --- a/src/v1_13/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_13/api/policy/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -429,8 +462,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_13::api::policy::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -444,8 +476,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -524,8 +567,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -592,8 +647,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -607,8 +661,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -673,8 +739,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_13::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -696,8 +761,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -763,8 +840,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -780,8 +856,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1/cluster_role.rs b/src/v1_13/api/rbac/v1/cluster_role.rs index c6c3cbb74a..9ce86f947c 100644 --- a/src/v1_13/api/rbac/v1/cluster_role.rs +++ b/src/v1_13/api/rbac/v1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRole), Created(crate::v1_13::api::rbac::v1::ClusterRole), Accepted(crate::v1_13::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::ClusterRole), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRole), Created(crate::v1_13::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1/cluster_role_binding.rs b/src/v1_13/api/rbac/v1/cluster_role_binding.rs index 5bae2f6ba8..dc481dc84f 100644 --- a/src/v1_13/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_13/api/rbac/v1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_13::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1/role.rs b/src/v1_13/api/rbac/v1/role.rs index 8b04567b1f..e00e9bd7d4 100644 --- a/src/v1_13/api/rbac/v1/role.rs +++ b/src/v1_13/api/rbac/v1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1::Role), Created(crate::v1_13::api::rbac::v1::Role), Accepted(crate::v1_13::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::Role), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1::Role), Created(crate::v1_13::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1/role_binding.rs b/src/v1_13/api/rbac/v1/role_binding.rs index 4dc44d6c18..2cf4357b5d 100644 --- a/src/v1_13/api/rbac/v1/role_binding.rs +++ b/src/v1_13/api/rbac/v1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::RoleBinding), Created(crate::v1_13::api::rbac::v1::RoleBinding), Accepted(crate::v1_13::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1::RoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1::RoleBinding), Created(crate::v1_13::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1alpha1/cluster_role.rs b/src/v1_13/api/rbac/v1alpha1/cluster_role.rs index b599728a95..5a20d0b627 100644 --- a/src/v1_13/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_13/api/rbac/v1alpha1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_13::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_13::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_13::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_13/api/rbac/v1alpha1/cluster_role_binding.rs index e05ef338ed..47bb58b830 100644 --- a/src/v1_13/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_13/api/rbac/v1alpha1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1alpha1/role.rs b/src/v1_13/api/rbac/v1alpha1/role.rs index bfbf12ee80..a95403a43a 100644 --- a/src/v1_13/api/rbac/v1alpha1/role.rs +++ b/src/v1_13/api/rbac/v1alpha1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::Role), Created(crate::v1_13::api::rbac::v1alpha1::Role), Accepted(crate::v1_13::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::Role), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1alpha1::Role), Created(crate::v1_13::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1alpha1/role_binding.rs b/src/v1_13/api/rbac/v1alpha1/role_binding.rs index b77346865f..930eb53cc6 100644 --- a/src/v1_13/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_13/api/rbac/v1alpha1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_13::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_13::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_13::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1beta1/cluster_role.rs b/src/v1_13/api/rbac/v1beta1/cluster_role.rs index 41902fa9fb..60144fcdb3 100644 --- a/src/v1_13/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_13/api/rbac/v1beta1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRole), Created(crate::v1_13::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_13::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRole), Created(crate::v1_13::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_13/api/rbac/v1beta1/cluster_role_binding.rs index 076343be1e..baba1fe8cf 100644 --- a/src/v1_13/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_13/api/rbac/v1beta1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -358,8 +379,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -432,8 +465,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -447,8 +479,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -527,8 +570,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -583,8 +638,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -598,8 +652,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_13::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -687,8 +752,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -771,8 +847,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1beta1/role.rs b/src/v1_13/api/rbac/v1beta1/role.rs index 2301ddb9c0..082acdf988 100644 --- a/src/v1_13/api/rbac/v1beta1/role.rs +++ b/src/v1_13/api/rbac/v1beta1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::Role), Created(crate::v1_13::api::rbac::v1beta1::Role), Accepted(crate::v1_13::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::Role), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -538,8 +582,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -553,8 +596,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -699,8 +765,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -714,8 +779,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -785,8 +862,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_13::api::rbac::v1beta1::Role), Created(crate::v1_13::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -808,8 +884,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -964,8 +1063,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -981,8 +1079,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/rbac/v1beta1/role_binding.rs b/src/v1_13/api/rbac/v1beta1/role_binding.rs index 0969450079..9658c962aa 100644 --- a/src/v1_13/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_13/api/rbac/v1beta1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBinding), Created(crate::v1_13::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_13::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -222,8 +233,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -250,8 +260,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -337,8 +359,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -373,8 +394,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -452,8 +485,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -467,8 +499,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -541,8 +585,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -556,8 +599,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -702,8 +768,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -717,8 +782,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -788,8 +865,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_13::api::rbac::v1beta1::RoleBinding), Created(crate::v1_13::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -811,8 +887,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -967,8 +1066,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -984,8 +1082,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/scheduling/v1alpha1/priority_class.rs b/src/v1_13/api/scheduling/v1alpha1/priority_class.rs index c42dbfd213..2c841dec1d 100644 --- a/src/v1_13/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_13/api/scheduling/v1alpha1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -325,8 +347,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -361,8 +382,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -435,8 +468,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -450,8 +482,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -530,8 +573,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -598,8 +653,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -613,8 +667,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_13::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -769,8 +846,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -786,8 +862,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/scheduling/v1beta1/priority_class.rs b/src/v1_13/api/scheduling/v1beta1/priority_class.rs index 1d02caa086..237c0b76e3 100644 --- a/src/v1_13/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_13/api/scheduling/v1beta1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_13::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_13::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -325,8 +347,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -361,8 +382,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -435,8 +468,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1beta1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -450,8 +482,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -530,8 +573,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -598,8 +653,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -613,8 +667,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_13::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_13::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -769,8 +846,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -786,8 +862,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/settings/v1alpha1/pod_preset.rs b/src/v1_13/api/settings/v1alpha1/pod_preset.rs index 58a9c2b750..b086de48af 100644 --- a/src/v1_13/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_13/api/settings/v1alpha1/pod_preset.rs @@ -77,8 +77,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPreset), Created(crate::v1_13::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_13::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -217,8 +228,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -245,8 +255,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -332,8 +354,7 @@ pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -368,8 +389,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { }; Ok((DeleteNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -447,8 +480,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -462,8 +494,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -536,8 +580,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -551,8 +594,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -795,8 +872,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_13::api::settings::v1alpha1::PodPreset), Created(crate::v1_13::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -818,8 +894,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -974,8 +1073,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -991,8 +1089,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/storage/v1/storage_class.rs b/src/v1_13/api/storage/v1/storage_class.rs index 586a51c884..aa55c511ca 100644 --- a/src/v1_13/api/storage/v1/storage_class.rs +++ b/src/v1_13/api/storage/v1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_13::api::storage::v1::StorageClass), Created(crate::v1_13::api::storage::v1::StorageClass), Accepted(crate::v1_13::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -229,8 +240,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -257,8 +267,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1::StorageClass), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_13::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_13::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -544,8 +587,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -612,8 +667,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_13::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -627,8 +681,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -693,8 +759,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_13::api::storage::v1::StorageClass), Created(crate::v1_13::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -716,8 +781,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -783,8 +860,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -800,8 +876,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/storage/v1/volume_attachment.rs b/src/v1_13/api/storage/v1/volume_attachment.rs index aa5023de4f..4e0aaf2b73 100644 --- a/src/v1_13/api/storage/v1/volume_attachment.rs +++ b/src/v1_13/api/storage/v1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), Created(crate::v1_13::api::storage::v1::VolumeAttachment), Accepted(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -214,8 +225,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -242,8 +252,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1::VolumeAttachment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -360,8 +381,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchVolumeAttachmentStatusOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentStatusResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentStatusResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchVolumeAttachmentStatusResponse { }; Ok((PatchVolumeAttachmentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -677,8 +743,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -692,8 +757,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -748,8 +825,7 @@ pub struct ReadVolumeAttachmentStatusOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentStatusResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentStatusResponse { @@ -763,8 +839,20 @@ impl crate::Response for ReadVolumeAttachmentStatusResponse { }; Ok((ReadVolumeAttachmentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -829,8 +917,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), Created(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -852,8 +939,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -918,8 +1017,7 @@ pub struct ReplaceVolumeAttachmentStatusOptional<'a> { pub enum ReplaceVolumeAttachmentStatusResponse { Ok(crate::v1_13::api::storage::v1::VolumeAttachment), Created(crate::v1_13::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentStatusResponse { @@ -941,8 +1039,20 @@ impl crate::Response for ReplaceVolumeAttachmentStatusResponse { }; Ok((ReplaceVolumeAttachmentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -1008,8 +1118,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/storage/v1alpha1/volume_attachment.rs b/src/v1_13/api/storage/v1alpha1/volume_attachment.rs index 30de24d003..3aaa86b38b 100644 --- a/src/v1_13/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_13/api/storage/v1alpha1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -214,8 +225,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -242,8 +252,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -360,8 +381,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -597,8 +652,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -612,8 +666,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -678,8 +744,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_13::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -701,8 +766,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -768,8 +845,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -785,8 +861,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/storage/v1beta1/storage_class.rs b/src/v1_13/api/storage/v1beta1/storage_class.rs index 57d3f6c608..68d2ccde6e 100644 --- a/src/v1_13/api/storage/v1beta1/storage_class.rs +++ b/src/v1_13/api/storage/v1beta1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_13::api::storage::v1beta1::StorageClass), Created(crate::v1_13::api::storage::v1beta1::StorageClass), Accepted(crate::v1_13::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -229,8 +240,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -257,8 +267,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1beta1::StorageClass), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -449,8 +482,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_13::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -464,8 +496,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_13::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -544,8 +587,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -612,8 +667,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_13::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -627,8 +681,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -693,8 +759,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_13::api::storage::v1beta1::StorageClass), Created(crate::v1_13::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -716,8 +781,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -783,8 +860,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -800,8 +876,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/api/storage/v1beta1/volume_attachment.rs b/src/v1_13/api/storage/v1beta1/volume_attachment.rs index 52bc0577aa..bfb96ec721 100644 --- a/src/v1_13/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_13/api/storage/v1beta1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_13::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_13::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -214,8 +225,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -242,8 +252,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -360,8 +381,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1beta1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -597,8 +652,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -612,8 +666,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -678,8 +744,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_13::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_13::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -701,8 +766,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -768,8 +845,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -785,8 +861,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_13/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index 4d0d8cdded..ae05e616aa 100644 --- a/src/v1_13/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_13/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -76,8 +76,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -321,8 +343,7 @@ pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { }; Ok((DeleteCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionStatusResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchCustomResourceDefinitionStatusResponse { }; Ok((PatchCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionStatusResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadCustomResourceDefinitionStatusResponse { }; Ok((ReadCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_13::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index ec4b1c3e93..382b145528 100644 --- a/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 31abe93f5b..3bbb6aefcf 100644 --- a/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_13/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -329,8 +351,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_13::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -357,8 +378,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -431,8 +464,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -446,8 +478,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -745,8 +822,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -760,8 +836,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -826,8 +914,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -915,8 +1014,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_13::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -938,8 +1036,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1005,8 +1115,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1022,8 +1131,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_13/mod.rs b/src/v1_13/mod.rs index 63b3091f42..21e87e061b 100644 --- a/src/v1_13/mod.rs +++ b/src/v1_13/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1APIResourcesResponse { }; Ok((GetApiregistrationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_auditregistration_api_group( #[derive(Debug)] pub enum GetAuditregistrationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuditregistrationAPIGroupResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuditregistrationAPIGroupResponse { }; Ok((GetAuditregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuditregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuditregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuditregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_auditregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAuditregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuditregistrationV1alpha1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuditregistrationV1alpha1APIResourcesResponse { }; Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_autoscaling_v2beta2_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta2APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { }; Ok((GetAutoscalingV2beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_13::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_coordination_api_group( #[derive(Debug)] pub enum GetCoordinationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationAPIGroupResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetCoordinationAPIGroupResponse { }; Ok((GetCoordinationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_coordination_v1beta1_api_resources( #[derive(Debug)] pub enum GetCoordinationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { }; Ok((GetCoordinationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2138,8 +2688,7 @@ pub fn get_scheduling_v1beta1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { @@ -2153,8 +2702,20 @@ impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { }; Ok((GetSchedulingV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2180,8 +2741,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -2195,8 +2755,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -2222,8 +2794,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -2237,8 +2808,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2264,8 +2847,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -2279,8 +2861,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2306,8 +2900,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2321,8 +2914,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2348,8 +2953,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2363,8 +2967,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2390,8 +3006,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_13::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2405,8 +3020,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2436,15 +3063,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2467,15 +3105,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_14/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 4f0d0aae92..f56ae44b50 100644 --- a/src/v1_14/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_14/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { }; Ok((DeleteMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_14::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_14/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index ee54833318..8565712f1f 100644 --- a/src/v1_14/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_14/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -74,8 +74,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { }; Ok((DeleteValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_14::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1/controller_revision.rs b/src/v1_14/api/apps/v1/controller_revision.rs index f555f044fd..9cd21e0108 100644 --- a/src/v1_14/api/apps/v1/controller_revision.rs +++ b/src/v1_14/api/apps/v1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevision), Created(crate::v1_14::api::apps::v1::ControllerRevision), Accepted(crate::v1_14::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::ControllerRevision), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -712,8 +778,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -727,8 +792,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -804,8 +881,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1::ControllerRevision), Created(crate::v1_14::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -827,8 +903,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -975,8 +1074,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -992,8 +1090,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1/daemon_set.rs b/src/v1_14/api/apps/v1/daemon_set.rs index bd88ddeca1..eeecf2c952 100644 --- a/src/v1_14/api/apps/v1/daemon_set.rs +++ b/src/v1_14/api/apps/v1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), Created(crate::v1_14::api::apps::v1::DaemonSet), Accepted(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::DaemonSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), Created(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1::DaemonSet), Created(crate::v1_14::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1/deployment.rs b/src/v1_14/api/apps/v1/deployment.rs index db637557bb..59f6af38a1 100644 --- a/src/v1_14/api/apps/v1/deployment.rs +++ b/src/v1_14/api/apps/v1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1::Deployment), Created(crate::v1_14::api::apps::v1::Deployment), Accepted(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::Deployment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1::Deployment), Created(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1::Deployment), Created(crate::v1_14::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1/replica_set.rs b/src/v1_14/api/apps/v1/replica_set.rs index 470bf0beaf..d1aa59f548 100644 --- a/src/v1_14/api/apps/v1/replica_set.rs +++ b/src/v1_14/api/apps/v1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), Created(crate::v1_14::api::apps::v1::ReplicaSet), Accepted(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::ReplicaSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), Created(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1::ReplicaSet), Created(crate::v1_14::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1/stateful_set.rs b/src/v1_14/api/apps/v1/stateful_set.rs index 228a271585..0089a0f2d6 100644 --- a/src/v1_14/api/apps/v1/stateful_set.rs +++ b/src/v1_14/api/apps/v1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), Created(crate::v1_14::api::apps::v1::StatefulSet), Accepted(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -218,8 +229,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -246,8 +256,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -333,8 +355,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1::StatefulSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -369,8 +390,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -544,8 +587,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -723,8 +789,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -738,8 +803,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -811,8 +888,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -902,8 +989,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), Created(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -1002,8 +1100,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1079,8 +1189,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1::StatefulSet), Created(crate::v1_14::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1102,8 +1211,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1170,8 +1291,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1187,8 +1307,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1250,8 +1382,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1267,8 +1398,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta1/controller_revision.rs b/src/v1_14/api/apps/v1beta1/controller_revision.rs index c52cb205bb..b15eab5782 100644 --- a/src/v1_14/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_14/api/apps/v1beta1/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevision), Created(crate::v1_14::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_14::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -712,8 +778,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -727,8 +792,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -804,8 +881,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta1::ControllerRevision), Created(crate::v1_14::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -827,8 +903,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -975,8 +1074,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -992,8 +1090,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta1/deployment.rs b/src/v1_14/api/apps/v1beta1/deployment.rs index 8c70fc1062..652964a1e5 100644 --- a/src/v1_14/api/apps/v1beta1/deployment.rs +++ b/src/v1_14/api/apps/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), Created(crate::v1_14::api::apps::v1beta1::Deployment), Accepted(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::Deployment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), Created(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::Deployment), Created(crate::v1_14::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta1/deployment_rollback.rs b/src/v1_14/api/apps/v1beta1/deployment_rollback.rs index 19f6b9b948..beba1fd450 100644 --- a/src/v1_14/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_14/api/apps/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta1/scale.rs b/src/v1_14/api/apps/v1beta1/scale.rs index 776d6c4186..a9886f3f62 100644 --- a/src/v1_14/api/apps/v1beta1/scale.rs +++ b/src/v1_14/api/apps/v1beta1/scale.rs @@ -91,8 +91,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -106,8 +105,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -203,8 +213,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -264,8 +286,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -279,8 +300,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -340,8 +373,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -355,8 +387,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -432,8 +476,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), Created(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -455,8 +498,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -532,8 +587,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta1::Scale), Created(crate::v1_14::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -555,8 +609,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta1/stateful_set.rs b/src/v1_14/api/apps/v1beta1/stateful_set.rs index e3422b5909..39cfce37b0 100644 --- a/src/v1_14/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_14/api/apps/v1beta1/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), Created(crate::v1_14::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -218,8 +229,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -246,8 +256,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -333,8 +355,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -369,8 +390,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -544,8 +587,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -723,8 +789,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -738,8 +803,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -811,8 +888,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -902,8 +989,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), Created(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -1002,8 +1100,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1079,8 +1189,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta1::StatefulSet), Created(crate::v1_14::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1102,8 +1211,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1170,8 +1291,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1187,8 +1307,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1250,8 +1382,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1267,8 +1398,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/controller_revision.rs b/src/v1_14/api/apps/v1beta2/controller_revision.rs index 914bd2b502..ee4b02c53a 100644 --- a/src/v1_14/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_14/api/apps/v1beta2/controller_revision.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevision), Created(crate::v1_14::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_14::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { }; Ok((DeleteNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -712,8 +778,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -727,8 +792,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -804,8 +881,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_14::api::apps::v1beta2::ControllerRevision), Created(crate::v1_14::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -827,8 +903,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -975,8 +1074,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -992,8 +1090,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/daemon_set.rs b/src/v1_14/api/apps/v1beta2/daemon_set.rs index 1d704e7192..4f172d1d5a 100644 --- a/src/v1_14/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_14/api/apps/v1beta2/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), Created(crate::v1_14::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), Created(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::DaemonSet), Created(crate::v1_14::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/deployment.rs b/src/v1_14/api/apps/v1beta2/deployment.rs index b5e0ee21f1..7386a53143 100644 --- a/src/v1_14/api/apps/v1beta2/deployment.rs +++ b/src/v1_14/api/apps/v1beta2/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), Created(crate::v1_14::api::apps::v1beta2::Deployment), Accepted(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::Deployment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), Created(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::Deployment), Created(crate::v1_14::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/replica_set.rs b/src/v1_14/api/apps/v1beta2/replica_set.rs index 6c43c420bd..c5cccec855 100644 --- a/src/v1_14/api/apps/v1beta2/replica_set.rs +++ b/src/v1_14/api/apps/v1beta2/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), Created(crate::v1_14::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), Created(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::ReplicaSet), Created(crate::v1_14::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/scale.rs b/src/v1_14/api/apps/v1beta2/scale.rs index 63859272c5..7d71a3fe8a 100644 --- a/src/v1_14/api/apps/v1beta2/scale.rs +++ b/src/v1_14/api/apps/v1beta2/scale.rs @@ -91,8 +91,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -106,8 +105,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -203,8 +213,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -285,8 +307,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -300,8 +321,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -361,8 +394,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -376,8 +408,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -437,8 +481,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -452,8 +495,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -513,8 +568,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -528,8 +582,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -605,8 +671,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), Created(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -628,8 +693,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -705,8 +782,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), Created(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -728,8 +804,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -805,8 +893,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::apps::v1beta2::Scale), Created(crate::v1_14::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -828,8 +915,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/apps/v1beta2/stateful_set.rs b/src/v1_14/api/apps/v1beta2/stateful_set.rs index 02e1ce0a85..0717e2ae9f 100644 --- a/src/v1_14/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_14/api/apps/v1beta2/stateful_set.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), Created(crate::v1_14::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -218,8 +229,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -246,8 +256,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -333,8 +355,7 @@ pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -369,8 +390,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { }; Ok((DeleteNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -444,8 +477,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -459,8 +491,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -529,8 +573,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -544,8 +587,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -723,8 +789,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -738,8 +803,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -811,8 +888,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -826,8 +902,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -902,8 +989,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -979,8 +1078,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), Created(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -1002,8 +1100,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1079,8 +1189,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_14::api::apps::v1beta2::StatefulSet), Created(crate::v1_14::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1102,8 +1211,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1170,8 +1291,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1187,8 +1307,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1250,8 +1382,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1267,8 +1398,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/auditregistration/v1alpha1/audit_sink.rs b/src/v1_14/api/auditregistration/v1alpha1/audit_sink.rs index 20b5c39c95..8419487b6a 100644 --- a/src/v1_14/api/auditregistration/v1alpha1/audit_sink.rs +++ b/src/v1_14/api/auditregistration/v1alpha1/audit_sink.rs @@ -73,8 +73,7 @@ pub enum CreateAuditSinkResponse { Ok(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), Created(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), Accepted(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAuditSinkResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateAuditSinkResponse { }; Ok((CreateAuditSinkResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAuditSinkResponse::Unauthorized, 0)), - _ => Ok((CreateAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAuditSinkResponse::Other(result), read)) + }, } } } @@ -186,8 +197,7 @@ pub enum DeleteAuditSinkResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAuditSinkResponse { @@ -222,8 +232,20 @@ impl crate::Response for DeleteAuditSinkResponse { }; Ok((DeleteAuditSinkResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAuditSinkResponse::Unauthorized, 0)), - _ => Ok((DeleteAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAuditSinkResponse::Other(result), read)) + }, } } } @@ -320,8 +342,7 @@ pub struct DeleteCollectionAuditSinkOptional<'a> { pub enum DeleteCollectionAuditSinkResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAuditSinkResponse { @@ -348,8 +369,20 @@ impl crate::Response for DeleteCollectionAuditSinkResponse { Ok((DeleteCollectionAuditSinkResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAuditSinkResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAuditSinkResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl AuditSink { #[derive(Debug)] pub enum ListAuditSinkResponse { Ok(crate::v1_14::api::auditregistration::v1alpha1::AuditSinkList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAuditSinkResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListAuditSinkResponse { }; Ok((ListAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ListAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAuditSinkResponse::Other(result), read)) + }, } } } @@ -510,8 +554,7 @@ pub struct PatchAuditSinkOptional<'a> { #[derive(Debug)] pub enum PatchAuditSinkResponse { Ok(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAuditSinkResponse { @@ -525,8 +568,20 @@ impl crate::Response for PatchAuditSinkResponse { }; Ok((PatchAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAuditSinkResponse::Unauthorized, 0)), - _ => Ok((PatchAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAuditSinkResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct ReadAuditSinkOptional<'a> { #[derive(Debug)] pub enum ReadAuditSinkResponse { Ok(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAuditSinkResponse { @@ -608,8 +662,20 @@ impl crate::Response for ReadAuditSinkResponse { }; Ok((ReadAuditSinkResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ReadAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAuditSinkResponse::Other(result), read)) + }, } } } @@ -680,8 +746,7 @@ pub struct ReplaceAuditSinkOptional<'a> { pub enum ReplaceAuditSinkResponse { Ok(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), Created(crate::v1_14::api::auditregistration::v1alpha1::AuditSink), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAuditSinkResponse { @@ -703,8 +768,20 @@ impl crate::Response for ReplaceAuditSinkResponse { }; Ok((ReplaceAuditSinkResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAuditSinkResponse::Unauthorized, 0)), - _ => Ok((ReplaceAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAuditSinkResponse::Other(result), read)) + }, } } } @@ -766,8 +843,7 @@ impl AuditSink { #[derive(Debug)] pub enum WatchAuditSinkResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAuditSinkResponse { @@ -783,8 +859,20 @@ impl crate::Response for WatchAuditSinkResponse { }; Ok((WatchAuditSinkResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAuditSinkResponse::Unauthorized, 0)), - _ => Ok((WatchAuditSinkResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAuditSinkResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authentication/v1/token_review.rs b/src/v1_14/api/authentication/v1/token_review.rs index b10937d3bc..ca897e6ac6 100644 --- a/src/v1_14/api/authentication/v1/token_review.rs +++ b/src/v1_14/api/authentication/v1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_14::api::authentication::v1::TokenReview), Created(crate::v1_14::api::authentication::v1::TokenReview), Accepted(crate::v1_14::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authentication/v1beta1/token_review.rs b/src/v1_14/api/authentication/v1beta1/token_review.rs index de86c77fc6..75ecc071ba 100644 --- a/src/v1_14/api/authentication/v1beta1/token_review.rs +++ b/src/v1_14/api/authentication/v1beta1/token_review.rs @@ -76,8 +76,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_14::api::authentication::v1beta1::TokenReview), Created(crate::v1_14::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_14::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1/local_subject_access_review.rs b/src/v1_14/api/authorization/v1/local_subject_access_review.rs index 8b7ee5561c..d833e48cc6 100644 --- a/src/v1_14/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_14/api/authorization/v1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_14::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1/self_subject_access_review.rs b/src/v1_14/api/authorization/v1/self_subject_access_review.rs index 2842c5d427..d32499157f 100644 --- a/src/v1_14/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_14/api/authorization/v1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_14::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1/self_subject_rules_review.rs b/src/v1_14/api/authorization/v1/self_subject_rules_review.rs index db636d54a8..e1fd55dc4d 100644 --- a/src/v1_14/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_14/api/authorization/v1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_14::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_14::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_14::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1/subject_access_review.rs b/src/v1_14/api/authorization/v1/subject_access_review.rs index 94e3d6901e..fb2e30dbab 100644 --- a/src/v1_14/api/authorization/v1/subject_access_review.rs +++ b/src/v1_14/api/authorization/v1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1::SubjectAccessReview), Created(crate::v1_14::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_14/api/authorization/v1beta1/local_subject_access_review.rs index 22d0f31ec5..c8826e5630 100644 --- a/src/v1_14/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_14/api/authorization/v1beta1/local_subject_access_review.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_14::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_14/api/authorization/v1beta1/self_subject_access_review.rs index 754aff98a4..7e53747789 100644 --- a/src/v1_14/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_14/api/authorization/v1beta1/self_subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_14::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_14/api/authorization/v1beta1/self_subject_rules_review.rs index 63895bc7f4..c1004dfcd9 100644 --- a/src/v1_14/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_14/api/authorization/v1beta1/self_subject_rules_review.rs @@ -76,8 +76,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_14::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_14::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_14::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/authorization/v1beta1/subject_access_review.rs b/src/v1_14/api/authorization/v1beta1/subject_access_review.rs index df18edc3c8..a432b581e0 100644 --- a/src/v1_14/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_14/api/authorization/v1beta1/subject_access_review.rs @@ -76,8 +76,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_14::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_14::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_14::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_14/api/autoscaling/v1/horizontal_pod_autoscaler.rs index 3211af1317..bfb94f0c1f 100644 --- a/src/v1_14/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_14/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/autoscaling/v1/scale.rs b/src/v1_14/api/autoscaling/v1/scale.rs index 3a68993e13..984f378c6d 100644 --- a/src/v1_14/api/autoscaling/v1/scale.rs +++ b/src/v1_14/api/autoscaling/v1/scale.rs @@ -91,8 +91,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -106,8 +105,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -203,8 +213,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -285,8 +307,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -300,8 +321,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -397,8 +429,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -458,8 +502,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -473,8 +516,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -534,8 +589,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -549,8 +603,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -610,8 +676,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -625,8 +690,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -686,8 +763,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -701,8 +777,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), Created(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -801,8 +888,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -878,8 +977,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), Created(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -901,8 +999,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -978,8 +1088,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), Created(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -1001,8 +1110,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -1078,8 +1199,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_14::api::autoscaling::v1::Scale), Created(crate::v1_14::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -1101,8 +1221,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_14/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index 275e25c973..1a32c43d75 100644 --- a/src/v1_14/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_14/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs b/src/v1_14/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs index 98f8d7ffd3..579622efe0 100644 --- a/src/v1_14/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs +++ b/src/v1_14/api/autoscaling/v2beta2/horizontal_pod_autoscaler.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { }; Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), Created(crate::v1_14::api::autoscaling::v2beta2::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/batch/v1/job.rs b/src/v1_14/api/batch/v1/job.rs index 83bacf2efc..58ee4a85ad 100644 --- a/src/v1_14/api/batch/v1/job.rs +++ b/src/v1_14/api/batch/v1/job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_14::api::batch::v1::Job), Created(crate::v1_14::api::batch::v1::Job), Accepted(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v1::Job), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedJobResponse { }; Ok((DeleteNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_14::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_14::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_14::api::batch::v1::Job), Created(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_14::api::batch::v1::Job), Created(crate::v1_14::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/batch/v1beta1/cron_job.rs b/src/v1_14/api/batch/v1beta1/cron_job.rs index 29fb4a11bb..9189002aa2 100644 --- a/src/v1_14/api/batch/v1beta1/cron_job.rs +++ b/src/v1_14/api/batch/v1beta1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), Created(crate::v1_14::api::batch::v1beta1::CronJob), Accepted(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v1beta1::CronJob), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), Created(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v1beta1::CronJob), Created(crate::v1_14::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/batch/v2alpha1/cron_job.rs b/src/v1_14/api/batch/v2alpha1/cron_job.rs index a919ceebd2..cd86aa7d9d 100644 --- a/src/v1_14/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_14/api/batch/v2alpha1/cron_job.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), Created(crate::v1_14::api::batch::v2alpha1::CronJob), Accepted(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::batch::v2alpha1::CronJob), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { }; Ok((DeleteNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), Created(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_14::api::batch::v2alpha1::CronJob), Created(crate::v1_14::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_14/api/certificates/v1beta1/certificate_signing_request.rs index 535fd72c27..4482545ed5 100644 --- a/src/v1_14/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_14/api/certificates/v1beta1/certificate_signing_request.rs @@ -76,8 +76,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { }; Ok((DeleteCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -323,8 +345,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -351,8 +372,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -421,8 +454,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -436,8 +468,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -513,8 +557,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -528,8 +571,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -605,8 +660,7 @@ pub struct PatchCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestStatusResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestStatusResponse { @@ -620,8 +674,20 @@ impl crate::Response for PatchCertificateSigningRequestStatusResponse { }; Ok((PatchCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -688,8 +754,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -703,8 +768,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReadCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestStatusResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestStatusResponse { @@ -774,8 +850,20 @@ impl crate::Response for ReadCertificateSigningRequestStatusResponse { }; Ok((ReadCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -869,8 +956,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -964,8 +1062,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -1036,8 +1146,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_14::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -1059,8 +1168,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -1122,8 +1243,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -1139,8 +1259,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/coordination/v1/lease.rs b/src/v1_14/api/coordination/v1/lease.rs index ce4dfb932d..240d7345cd 100644 --- a/src/v1_14/api/coordination/v1/lease.rs +++ b/src/v1_14/api/coordination/v1/lease.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1::Lease), Created(crate::v1_14::api::coordination::v1::Lease), Accepted(crate::v1_14::api::coordination::v1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLeaseResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLeaseResponse { }; Ok((CreateNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedLeaseOptional<'a> { pub enum DeleteCollectionNamespacedLeaseResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::coordination::v1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLeaseResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedLeaseResponse { Ok((DeleteCollectionNamespacedLeaseResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedLeaseResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::coordination::v1::Lease), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLeaseResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedLeaseResponse { }; Ok((DeleteNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl Lease { #[derive(Debug)] pub enum ListLeaseForAllNamespacesResponse { Ok(crate::v1_14::api::coordination::v1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLeaseForAllNamespacesResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListLeaseForAllNamespacesResponse { }; Ok((ListLeaseForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl Lease { #[derive(Debug)] pub enum ListNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLeaseResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListNamespacedLeaseResponse { }; Ok((ListNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLeaseResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedLeaseResponse { }; Ok((PatchNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLeaseResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedLeaseResponse { }; Ok((ReadNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedLeaseOptional<'a> { pub enum ReplaceNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1::Lease), Created(crate::v1_14::api::coordination::v1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLeaseResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedLeaseResponse { }; Ok((ReplaceNamespacedLeaseResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl Lease { #[derive(Debug)] pub enum WatchLeaseForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLeaseForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLeaseForAllNamespacesResponse { }; Ok((WatchLeaseForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl Lease { #[derive(Debug)] pub enum WatchNamespacedLeaseResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLeaseResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchNamespacedLeaseResponse { }; Ok((WatchNamespacedLeaseResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLeaseResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/coordination/v1beta1/lease.rs b/src/v1_14/api/coordination/v1beta1/lease.rs index 658bf73e9a..c33c8b5068 100644 --- a/src/v1_14/api/coordination/v1beta1/lease.rs +++ b/src/v1_14/api/coordination/v1beta1/lease.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1beta1::Lease), Created(crate::v1_14::api::coordination::v1beta1::Lease), Accepted(crate::v1_14::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLeaseResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLeaseResponse { }; Ok((CreateNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedLeaseOptional<'a> { pub enum DeleteCollectionNamespacedLeaseResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLeaseResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedLeaseResponse { Ok((DeleteCollectionNamespacedLeaseResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedLeaseResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::coordination::v1beta1::Lease), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLeaseResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedLeaseResponse { }; Ok((DeleteNamespacedLeaseResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl Lease { #[derive(Debug)] pub enum ListLeaseForAllNamespacesResponse { Ok(crate::v1_14::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLeaseForAllNamespacesResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListLeaseForAllNamespacesResponse { }; Ok((ListLeaseForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl Lease { #[derive(Debug)] pub enum ListNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1beta1::LeaseList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLeaseResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListNamespacedLeaseResponse { }; Ok((ListNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLeaseResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedLeaseResponse { }; Ok((PatchNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedLeaseOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLeaseResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedLeaseResponse { }; Ok((ReadNamespacedLeaseResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedLeaseOptional<'a> { pub enum ReplaceNamespacedLeaseResponse { Ok(crate::v1_14::api::coordination::v1beta1::Lease), Created(crate::v1_14::api::coordination::v1beta1::Lease), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLeaseResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedLeaseResponse { }; Ok((ReplaceNamespacedLeaseResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLeaseResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl Lease { #[derive(Debug)] pub enum WatchLeaseForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLeaseForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLeaseForAllNamespacesResponse { }; Ok((WatchLeaseForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLeaseForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLeaseForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLeaseForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl Lease { #[derive(Debug)] pub enum WatchNamespacedLeaseResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLeaseResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchNamespacedLeaseResponse { }; Ok((WatchNamespacedLeaseResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLeaseResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLeaseResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLeaseResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/binding.rs b/src/v1_14/api/core/v1/binding.rs index d2e00b2965..c929e4bb13 100644 --- a/src/v1_14/api/core/v1/binding.rs +++ b/src/v1_14/api/core/v1/binding.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_14::api::core::v1::Binding), Created(crate::v1_14::api::core::v1::Binding), Accepted(crate::v1_14::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_14::api::core::v1::Binding), Created(crate::v1_14::api::core::v1::Binding), Accepted(crate::v1_14::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -219,8 +229,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/component_status.rs b/src/v1_14/api/core/v1/component_status.rs index fed1a62050..84a730db14 100644 --- a/src/v1_14/api/core/v1/component_status.rs +++ b/src/v1_14/api/core/v1/component_status.rs @@ -76,8 +76,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_14::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -91,8 +90,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -147,8 +158,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_14::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -162,8 +172,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -225,8 +247,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -242,8 +263,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/config_map.rs b/src/v1_14/api/core/v1/config_map.rs index 0ad861ec3d..651b5b83fa 100644 --- a/src/v1_14/api/core/v1/config_map.rs +++ b/src/v1_14/api/core/v1/config_map.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_14::api::core::v1::ConfigMap), Created(crate::v1_14::api::core::v1::ConfigMap), Accepted(crate::v1_14::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ConfigMap), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { }; Ok((DeleteNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_14::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_14::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -712,8 +778,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_14::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -727,8 +792,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -804,8 +881,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_14::api::core::v1::ConfigMap), Created(crate::v1_14::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -827,8 +903,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -975,8 +1074,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -992,8 +1090,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/endpoints.rs b/src/v1_14/api/core/v1/endpoints.rs index f4151b1708..9c8e712713 100644 --- a/src/v1_14/api/core/v1/endpoints.rs +++ b/src/v1_14/api/core/v1/endpoints.rs @@ -90,8 +90,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_14::api::core::v1::Endpoints), Created(crate::v1_14::api::core::v1::Endpoints), Accepted(crate::v1_14::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -121,8 +120,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -224,8 +235,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -252,8 +262,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -339,8 +361,7 @@ pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Endpoints), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -375,8 +396,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { }; Ok((DeleteNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -445,8 +478,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -460,8 +492,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -535,8 +579,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_14::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -550,8 +593,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -632,8 +687,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_14::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -647,8 +701,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -720,8 +786,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_14::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -735,8 +800,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -812,8 +889,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_14::api::core::v1::Endpoints), Created(crate::v1_14::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -835,8 +911,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -983,8 +1082,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/event.rs b/src/v1_14/api/core/v1/event.rs index 90c9644a3d..0ced224872 100644 --- a/src/v1_14/api/core/v1/event.rs +++ b/src/v1_14/api/core/v1/event.rs @@ -118,8 +118,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_14::api::core::v1::Event), Created(crate::v1_14::api::core::v1::Event), Accepted(crate::v1_14::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -149,8 +148,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -252,8 +263,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -280,8 +290,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -367,8 +389,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Event), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -403,8 +424,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -473,8 +506,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -488,8 +520,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -563,8 +607,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_14::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -578,8 +621,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -660,8 +715,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_14::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -675,8 +729,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -748,8 +814,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_14::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -763,8 +828,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -840,8 +917,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_14::api::core::v1::Event), Created(crate::v1_14::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -863,8 +939,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -926,8 +1014,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -943,8 +1030,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1011,8 +1110,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1028,8 +1126,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/limit_range.rs b/src/v1_14/api/core/v1/limit_range.rs index 23bc687f37..1484cc3ce0 100644 --- a/src/v1_14/api/core/v1/limit_range.rs +++ b/src/v1_14/api/core/v1/limit_range.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_14::api::core::v1::LimitRange), Created(crate::v1_14::api::core::v1::LimitRange), Accepted(crate::v1_14::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::LimitRange), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { }; Ok((DeleteNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -434,8 +467,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -449,8 +481,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_14::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_14::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_14::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_14::api::core::v1::LimitRange), Created(crate::v1_14::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -887,8 +975,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -904,8 +991,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/namespace.rs b/src/v1_14/api/core/v1/namespace.rs index 1ea38c75ef..3fa54cac7f 100644 --- a/src/v1_14/api/core/v1/namespace.rs +++ b/src/v1_14/api/core/v1/namespace.rs @@ -77,8 +77,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_14::api::core::v1::Namespace), Created(crate::v1_14::api::core::v1::Namespace), Accepted(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteNamespaceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Namespace), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteNamespaceResponse { }; Ok((DeleteNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -296,8 +318,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_14::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -311,8 +332,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -388,8 +421,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -403,8 +435,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -480,8 +524,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -495,8 +538,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -563,8 +618,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -578,8 +632,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -649,8 +714,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -721,8 +798,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_14::api::core::v1::Namespace), Created(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -744,8 +820,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_14::api::core::v1::Namespace), Created(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -839,8 +926,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -911,8 +1010,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_14::api::core::v1::Namespace), Created(crate::v1_14::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -934,8 +1032,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -997,8 +1107,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -1014,8 +1123,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/node.rs b/src/v1_14/api/core/v1/node.rs index d627b9d449..243ee55782 100644 --- a/src/v1_14/api/core/v1/node.rs +++ b/src/v1_14/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -912,8 +1022,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_14::api::core::v1::Node), Created(crate::v1_14::api::core::v1::Node), Accepted(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -943,8 +1052,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1041,8 +1162,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1069,8 +1189,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1151,8 +1283,7 @@ pub enum DeleteNodeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Node), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1187,8 +1318,20 @@ impl crate::Response for DeleteNodeResponse { }; Ok((DeleteNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1257,8 +1400,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_14::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1272,8 +1414,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1349,8 +1503,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1364,8 +1517,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1441,8 +1606,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1456,8 +1620,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1524,8 +1700,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -1539,8 +1714,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -1595,8 +1782,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -1610,8 +1796,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -1682,8 +1880,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_14::api::core::v1::Node), Created(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -1705,8 +1902,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -1777,8 +1986,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_14::api::core::v1::Node), Created(crate::v1_14::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -1800,8 +2008,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -1863,8 +2083,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -1880,8 +2099,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/persistent_volume.rs b/src/v1_14/api/core/v1/persistent_volume.rs index 1eeb8b2ae6..7238f5e28c 100644 --- a/src/v1_14/api/core/v1/persistent_volume.rs +++ b/src/v1_14/api/core/v1/persistent_volume.rs @@ -77,8 +77,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), Created(crate::v1_14::api::core::v1::PersistentVolume), Accepted(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -206,8 +217,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -234,8 +244,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PersistentVolume), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeletePersistentVolumeResponse { }; Ok((DeletePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -606,8 +661,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -621,8 +675,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -689,8 +755,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -847,8 +935,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), Created(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -870,8 +957,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -942,8 +1041,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolume), Created(crate::v1_14::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -965,8 +1063,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -1028,8 +1138,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -1045,8 +1154,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/persistent_volume_claim.rs b/src/v1_14/api/core/v1/persistent_volume_claim.rs index fc3dfbf94f..257c558e3d 100644 --- a/src/v1_14/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_14/api/core/v1/persistent_volume_claim.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), Created(crate::v1_14::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { }; Ok((DeleteNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), Created(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_14::api::core::v1::PersistentVolumeClaim), Created(crate::v1_14::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/pod.rs b/src/v1_14/api/core/v1/pod.rs index 21b06190cd..1c6d77fd56 100644 --- a/src/v1_14/api/core/v1/pod.rs +++ b/src/v1_14/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1591,8 +1767,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_14::api::core::v1::Pod), Created(crate::v1_14::api::core::v1::Pod), Accepted(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1622,8 +1797,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1725,8 +1912,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1753,8 +1939,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1840,8 +2038,7 @@ pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Pod), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1876,8 +2073,20 @@ impl crate::Response for DeleteNamespacedPodResponse { }; Ok((DeleteNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1951,8 +2160,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_14::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1966,8 +2174,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2036,8 +2256,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2051,8 +2270,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2133,8 +2364,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2148,8 +2378,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2230,8 +2472,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2245,8 +2486,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2318,8 +2571,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2333,8 +2585,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2436,8 +2700,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -2461,8 +2724,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -2522,8 +2797,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -2537,8 +2811,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2614,8 +2900,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_14::api::core::v1::Pod), Created(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -2637,8 +2922,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2714,8 +3011,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_14::api::core::v1::Pod), Created(crate::v1_14::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -2737,8 +3033,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2805,8 +3113,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -2822,8 +3129,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2885,8 +3204,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -2902,8 +3220,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/pod_template.rs b/src/v1_14/api/core/v1/pod_template.rs index 3e0c85ab9d..19b08bd522 100644 --- a/src/v1_14/api/core/v1/pod_template.rs +++ b/src/v1_14/api/core/v1/pod_template.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_14::api::core::v1::PodTemplate), Created(crate::v1_14::api::core::v1::PodTemplate), Accepted(crate::v1_14::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::PodTemplate), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { }; Ok((DeleteNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_14::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_14::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_14::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_14::api::core::v1::PodTemplate), Created(crate::v1_14::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/replication_controller.rs b/src/v1_14/api/core/v1/replication_controller.rs index fc9cc60cbf..61bfe46ff3 100644 --- a/src/v1_14/api/core/v1/replication_controller.rs +++ b/src/v1_14/api/core/v1/replication_controller.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), Created(crate::v1_14::api::core::v1::ReplicationController), Accepted(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ReplicationController), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { }; Ok((DeleteNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_14::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), Created(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_14::api::core::v1::ReplicationController), Created(crate::v1_14::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/resource_quota.rs b/src/v1_14/api/core/v1/resource_quota.rs index 6b37f225a8..2f05db8eb3 100644 --- a/src/v1_14/api/core/v1/resource_quota.rs +++ b/src/v1_14/api/core/v1/resource_quota.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), Created(crate::v1_14::api::core::v1::ResourceQuota), Accepted(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ResourceQuota), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { }; Ok((DeleteNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_14::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), Created(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_14::api::core::v1::ResourceQuota), Created(crate::v1_14::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/secret.rs b/src/v1_14/api/core/v1/secret.rs index 6de3052c23..58572f1c6e 100644 --- a/src/v1_14/api/core/v1/secret.rs +++ b/src/v1_14/api/core/v1/secret.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_14::api::core::v1::Secret), Created(crate::v1_14::api::core::v1::Secret), Accepted(crate::v1_14::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Secret), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { }; Ok((DeleteNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -445,8 +478,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_14::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -460,8 +492,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -530,8 +574,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -545,8 +588,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -627,8 +682,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_14::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -642,8 +696,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -715,8 +781,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_14::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -730,8 +795,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -807,8 +884,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_14::api::core::v1::Secret), Created(crate::v1_14::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -830,8 +906,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -978,8 +1077,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -995,8 +1093,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/service.rs b/src/v1_14/api/core/v1/service.rs index 40fb5a379c..a10bf0637d 100644 --- a/src/v1_14/api/core/v1/service.rs +++ b/src/v1_14/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -967,8 +1077,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_14::api::core::v1::Service), Created(crate::v1_14::api::core::v1::Service), Accepted(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -998,8 +1107,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1085,8 +1206,7 @@ pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::Service), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1121,8 +1241,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { }; Ok((DeleteNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1196,8 +1328,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_14::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1211,8 +1342,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1281,8 +1424,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1296,8 +1438,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1378,8 +1532,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1393,8 +1546,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1475,8 +1640,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1490,8 +1654,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1563,8 +1739,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -1578,8 +1753,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1639,8 +1826,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -1654,8 +1840,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1731,8 +1929,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_14::api::core::v1::Service), Created(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -1754,8 +1951,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1831,8 +2040,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_14::api::core::v1::Service), Created(crate::v1_14::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -1854,8 +2062,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1922,8 +2142,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -1939,8 +2158,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2002,8 +2233,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -2019,8 +2249,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/core/v1/service_account.rs b/src/v1_14/api/core/v1/service_account.rs index 2d013d9a5b..73da6cf0c1 100644 --- a/src/v1_14/api/core/v1/service_account.rs +++ b/src/v1_14/api/core/v1/service_account.rs @@ -85,8 +85,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_14::api::core::v1::ServiceAccount), Created(crate::v1_14::api::core::v1::ServiceAccount), Accepted(crate::v1_14::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -116,8 +115,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -219,8 +230,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -247,8 +257,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -334,8 +356,7 @@ pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::core::v1::ServiceAccount), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -370,8 +391,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { }; Ok((DeleteNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -445,8 +478,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_14::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -460,8 +492,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -530,8 +574,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_14::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -545,8 +588,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -627,8 +682,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_14::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -642,8 +696,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -715,8 +781,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_14::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -730,8 +795,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -807,8 +884,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_14::api::core::v1::ServiceAccount), Created(crate::v1_14::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -830,8 +906,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -898,8 +986,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -915,8 +1002,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -978,8 +1077,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -995,8 +1093,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/events/v1beta1/event.rs b/src/v1_14/api/events/v1beta1/event.rs index 58964eeb4c..401f64fa87 100644 --- a/src/v1_14/api/events/v1beta1/event.rs +++ b/src/v1_14/api/events/v1beta1/event.rs @@ -117,8 +117,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_14::api::events::v1beta1::Event), Created(crate::v1_14::api::events::v1beta1::Event), Accepted(crate::v1_14::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -148,8 +147,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -251,8 +262,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -279,8 +289,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -366,8 +388,7 @@ pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::events::v1beta1::Event), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -402,8 +423,20 @@ impl crate::Response for DeleteNamespacedEventResponse { }; Ok((DeleteNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -472,8 +505,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_14::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -487,8 +519,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -562,8 +606,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_14::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -577,8 +620,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -659,8 +714,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_14::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -674,8 +728,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -747,8 +813,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_14::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -762,8 +827,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -839,8 +916,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_14::api::events::v1beta1::Event), Created(crate::v1_14::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -862,8 +938,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -925,8 +1013,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -942,8 +1029,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1010,8 +1109,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -1027,8 +1125,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/daemon_set.rs b/src/v1_14/api/extensions/v1beta1/daemon_set.rs index d31aa90910..c886260ef7 100644 --- a/src/v1_14/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_14/api/extensions/v1beta1/daemon_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), Created(crate::v1_14::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { }; Ok((DeleteNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), Created(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::DaemonSet), Created(crate::v1_14::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/deployment.rs b/src/v1_14/api/extensions/v1beta1/deployment.rs index 997a1c4dcb..135965e952 100644 --- a/src/v1_14/api/extensions/v1beta1/deployment.rs +++ b/src/v1_14/api/extensions/v1beta1/deployment.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), Created(crate::v1_14::api::extensions::v1beta1::Deployment), Accepted(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::Deployment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { }; Ok((DeleteNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_14::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_14::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), Created(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Deployment), Created(crate::v1_14::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_14/api/extensions/v1beta1/deployment_rollback.rs index a0fe3f7fbc..b334f05a33 100644 --- a/src/v1_14/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_14/api/extensions/v1beta1/deployment_rollback.rs @@ -87,8 +87,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -118,8 +117,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/ingress.rs b/src/v1_14/api/extensions/v1beta1/ingress.rs index d176c089be..360bc62e1e 100644 --- a/src/v1_14/api/extensions/v1beta1/ingress.rs +++ b/src/v1_14/api/extensions/v1beta1/ingress.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), Created(crate::v1_14::api::extensions::v1beta1::Ingress), Accepted(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::Ingress), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { }; Ok((DeleteNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_14::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_14::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), Created(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::Ingress), Created(crate::v1_14::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/network_policy.rs b/src/v1_14/api/extensions/v1beta1/network_policy.rs index a707a42792..5e61eb3787 100644 --- a/src/v1_14/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_14/api/extensions/v1beta1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_14::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_14/api/extensions/v1beta1/pod_security_policy.rs index 3719699053..8d1668bff4 100644 --- a/src/v1_14/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_14/api/extensions/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_14::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/replica_set.rs b/src/v1_14/api/extensions/v1beta1/replica_set.rs index 852f9adff0..4af7c9e865 100644 --- a/src/v1_14/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_14/api/extensions/v1beta1/replica_set.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_14::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { }; Ok((DeleteNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_14::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_14::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1168,8 +1289,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1185,8 +1305,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/extensions/v1beta1/scale.rs b/src/v1_14/api/extensions/v1beta1/scale.rs index 6b64a0c886..0baf99f583 100644 --- a/src/v1_14/api/extensions/v1beta1/scale.rs +++ b/src/v1_14/api/extensions/v1beta1/scale.rs @@ -91,8 +91,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -106,8 +105,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -188,8 +199,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -203,8 +213,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -285,8 +307,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -300,8 +321,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -361,8 +394,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -376,8 +408,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -437,8 +481,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -452,8 +495,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -513,8 +568,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -528,8 +582,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -605,8 +671,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), Created(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -628,8 +693,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -705,8 +782,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), Created(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -728,8 +804,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -805,8 +893,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_14::api::extensions::v1beta1::Scale), Created(crate::v1_14::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -828,8 +915,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/networking/v1/network_policy.rs b/src/v1_14/api/networking/v1/network_policy.rs index 3910661894..0769d34f53 100644 --- a/src/v1_14/api/networking/v1/network_policy.rs +++ b/src/v1_14/api/networking/v1/network_policy.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicy), Created(crate::v1_14::api::networking::v1::NetworkPolicy), Accepted(crate::v1_14::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::networking::v1::NetworkPolicy), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { }; Ok((DeleteNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -709,8 +775,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -801,8 +878,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_14::api::networking::v1::NetworkPolicy), Created(crate::v1_14::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -892,8 +980,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -909,8 +996,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -972,8 +1071,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -989,8 +1087,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/networking/v1beta1/ingress.rs b/src/v1_14/api/networking/v1beta1/ingress.rs index a5e94f3a25..56e8a127a0 100644 --- a/src/v1_14/api/networking/v1beta1/ingress.rs +++ b/src/v1_14/api/networking/v1beta1/ingress.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), Created(crate::v1_14::api::networking::v1beta1::Ingress), Accepted(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::networking::v1beta1::Ingress), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { }; Ok((DeleteNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_14::api::networking::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_14::api::networking::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -721,8 +787,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -736,8 +801,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -809,8 +886,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -824,8 +900,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -900,8 +987,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -977,8 +1076,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), Created(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -1000,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1077,8 +1187,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_14::api::networking::v1beta1::Ingress), Created(crate::v1_14::api::networking::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1100,8 +1209,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1163,8 +1284,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1180,8 +1300,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1248,8 +1380,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1265,8 +1396,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/node/v1alpha1/runtime_class.rs b/src/v1_14/api/node/v1alpha1/runtime_class.rs index d150966aa9..8b0a1be56a 100644 --- a/src/v1_14/api/node/v1alpha1/runtime_class.rs +++ b/src/v1_14/api/node/v1alpha1/runtime_class.rs @@ -74,8 +74,7 @@ pub enum CreateRuntimeClassResponse { Ok(crate::v1_14::api::node::v1alpha1::RuntimeClass), Created(crate::v1_14::api::node::v1alpha1::RuntimeClass), Accepted(crate::v1_14::api::node::v1alpha1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateRuntimeClassResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateRuntimeClassResponse { }; Ok((CreateRuntimeClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((CreateRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateRuntimeClassResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionRuntimeClassOptional<'a> { pub enum DeleteCollectionRuntimeClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::node::v1alpha1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionRuntimeClassResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionRuntimeClassResponse { Ok((DeleteCollectionRuntimeClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionRuntimeClassResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeleteRuntimeClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::node::v1alpha1::RuntimeClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteRuntimeClassResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteRuntimeClassResponse { }; Ok((DeleteRuntimeClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((DeleteRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteRuntimeClassResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl RuntimeClass { #[derive(Debug)] pub enum ListRuntimeClassResponse { Ok(crate::v1_14::api::node::v1alpha1::RuntimeClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRuntimeClassResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListRuntimeClassResponse { }; Ok((ListRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ListRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRuntimeClassResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchRuntimeClassOptional<'a> { #[derive(Debug)] pub enum PatchRuntimeClassResponse { Ok(crate::v1_14::api::node::v1alpha1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchRuntimeClassResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchRuntimeClassResponse { }; Ok((PatchRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((PatchRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchRuntimeClassResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadRuntimeClassOptional<'a> { #[derive(Debug)] pub enum ReadRuntimeClassResponse { Ok(crate::v1_14::api::node::v1alpha1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadRuntimeClassResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadRuntimeClassResponse { }; Ok((ReadRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ReadRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadRuntimeClassResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceRuntimeClassOptional<'a> { pub enum ReplaceRuntimeClassResponse { Ok(crate::v1_14::api::node::v1alpha1::RuntimeClass), Created(crate::v1_14::api::node::v1alpha1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceRuntimeClassResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceRuntimeClassResponse { }; Ok((ReplaceRuntimeClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceRuntimeClassResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl RuntimeClass { #[derive(Debug)] pub enum WatchRuntimeClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRuntimeClassResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchRuntimeClassResponse { }; Ok((WatchRuntimeClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((WatchRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRuntimeClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/node/v1beta1/runtime_class.rs b/src/v1_14/api/node/v1beta1/runtime_class.rs index 9506ab065f..5f3d4bbbee 100644 --- a/src/v1_14/api/node/v1beta1/runtime_class.rs +++ b/src/v1_14/api/node/v1beta1/runtime_class.rs @@ -74,8 +74,7 @@ pub enum CreateRuntimeClassResponse { Ok(crate::v1_14::api::node::v1beta1::RuntimeClass), Created(crate::v1_14::api::node::v1beta1::RuntimeClass), Accepted(crate::v1_14::api::node::v1beta1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateRuntimeClassResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateRuntimeClassResponse { }; Ok((CreateRuntimeClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((CreateRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateRuntimeClassResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionRuntimeClassOptional<'a> { pub enum DeleteCollectionRuntimeClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::node::v1beta1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionRuntimeClassResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionRuntimeClassResponse { Ok((DeleteCollectionRuntimeClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionRuntimeClassResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeleteRuntimeClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::node::v1beta1::RuntimeClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteRuntimeClassResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteRuntimeClassResponse { }; Ok((DeleteRuntimeClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((DeleteRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteRuntimeClassResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl RuntimeClass { #[derive(Debug)] pub enum ListRuntimeClassResponse { Ok(crate::v1_14::api::node::v1beta1::RuntimeClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRuntimeClassResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListRuntimeClassResponse { }; Ok((ListRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ListRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRuntimeClassResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchRuntimeClassOptional<'a> { #[derive(Debug)] pub enum PatchRuntimeClassResponse { Ok(crate::v1_14::api::node::v1beta1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchRuntimeClassResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchRuntimeClassResponse { }; Ok((PatchRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((PatchRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchRuntimeClassResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadRuntimeClassOptional<'a> { #[derive(Debug)] pub enum ReadRuntimeClassResponse { Ok(crate::v1_14::api::node::v1beta1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadRuntimeClassResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadRuntimeClassResponse { }; Ok((ReadRuntimeClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ReadRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadRuntimeClassResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceRuntimeClassOptional<'a> { pub enum ReplaceRuntimeClassResponse { Ok(crate::v1_14::api::node::v1beta1::RuntimeClass), Created(crate::v1_14::api::node::v1beta1::RuntimeClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceRuntimeClassResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceRuntimeClassResponse { }; Ok((ReplaceRuntimeClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceRuntimeClassResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl RuntimeClass { #[derive(Debug)] pub enum WatchRuntimeClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRuntimeClassResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchRuntimeClassResponse { }; Ok((WatchRuntimeClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRuntimeClassResponse::Unauthorized, 0)), - _ => Ok((WatchRuntimeClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRuntimeClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/policy/v1beta1/eviction.rs b/src/v1_14/api/policy/v1beta1/eviction.rs index 78ea2e86ca..b4586ec8e0 100644 --- a/src/v1_14/api/policy/v1beta1/eviction.rs +++ b/src/v1_14/api/policy/v1beta1/eviction.rs @@ -84,8 +84,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_14::api::policy::v1beta1::Eviction), Created(crate::v1_14::api::policy::v1beta1::Eviction), Accepted(crate::v1_14::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -115,8 +114,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_14/api/policy/v1beta1/pod_disruption_budget.rs index 3c4977d031..c915c8a6fb 100644 --- a/src/v1_14/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_14/api/policy/v1beta1/pod_disruption_budget.rs @@ -81,8 +81,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -112,8 +111,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -215,8 +226,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -243,8 +253,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -330,8 +352,7 @@ pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -366,8 +387,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { }; Ok((DeleteNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -441,8 +474,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -456,8 +488,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -526,8 +570,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -541,8 +584,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -623,8 +678,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -638,8 +692,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -720,8 +786,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -735,8 +800,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -808,8 +885,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -823,8 +899,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -884,8 +972,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -899,8 +986,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -976,8 +1075,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -999,8 +1097,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1076,8 +1186,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_14::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1099,8 +1208,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1167,8 +1288,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1184,8 +1304,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1247,8 +1379,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1264,8 +1395,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/policy/v1beta1/pod_security_policy.rs b/src/v1_14/api/policy/v1beta1/pod_security_policy.rs index d89b1bebc1..55fd4d2c24 100644 --- a/src/v1_14/api/policy/v1beta1/pod_security_policy.rs +++ b/src/v1_14/api/policy/v1beta1/pod_security_policy.rs @@ -74,8 +74,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { }; Ok((DeletePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_14::api::policy::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), Created(crate::v1_14::api::policy::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1/cluster_role.rs b/src/v1_14/api/rbac/v1/cluster_role.rs index fc3de84adb..5e610ac132 100644 --- a/src/v1_14/api/rbac/v1/cluster_role.rs +++ b/src/v1_14/api/rbac/v1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRole), Created(crate::v1_14::api::rbac::v1::ClusterRole), Accepted(crate::v1_14::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::ClusterRole), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRole), Created(crate::v1_14::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1/cluster_role_binding.rs b/src/v1_14/api/rbac/v1/cluster_role_binding.rs index 07a144b5e9..1f05e79a36 100644 --- a/src/v1_14/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_14/api/rbac/v1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_14::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1/role.rs b/src/v1_14/api/rbac/v1/role.rs index 0a14a7f3e4..58991c80ee 100644 --- a/src/v1_14/api/rbac/v1/role.rs +++ b/src/v1_14/api/rbac/v1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1::Role), Created(crate::v1_14::api::rbac::v1::Role), Accepted(crate::v1_14::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::Role), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -697,8 +763,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -712,8 +777,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -789,8 +866,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1::Role), Created(crate::v1_14::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -812,8 +888,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -960,8 +1059,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -977,8 +1075,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1/role_binding.rs b/src/v1_14/api/rbac/v1/role_binding.rs index 5b04de413b..19fee1c6a0 100644 --- a/src/v1_14/api/rbac/v1/role_binding.rs +++ b/src/v1_14/api/rbac/v1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::RoleBinding), Created(crate::v1_14::api::rbac::v1::RoleBinding), Accepted(crate::v1_14::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1::RoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -700,8 +766,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -715,8 +780,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -792,8 +869,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1::RoleBinding), Created(crate::v1_14::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -815,8 +891,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -980,8 +1078,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1alpha1/cluster_role.rs b/src/v1_14/api/rbac/v1alpha1/cluster_role.rs index eec31534fd..b8f3a03e35 100644 --- a/src/v1_14/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_14/api/rbac/v1alpha1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_14::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_14::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_14::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_14/api/rbac/v1alpha1/cluster_role_binding.rs index 83c241d5ef..27e591be09 100644 --- a/src/v1_14/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_14/api/rbac/v1alpha1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1alpha1/role.rs b/src/v1_14/api/rbac/v1alpha1/role.rs index 127aa3c027..7882bc8fe0 100644 --- a/src/v1_14/api/rbac/v1alpha1/role.rs +++ b/src/v1_14/api/rbac/v1alpha1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::Role), Created(crate::v1_14::api::rbac::v1alpha1::Role), Accepted(crate::v1_14::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::Role), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -697,8 +763,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -712,8 +777,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -789,8 +866,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1alpha1::Role), Created(crate::v1_14::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -812,8 +888,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -960,8 +1059,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -977,8 +1075,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1alpha1/role_binding.rs b/src/v1_14/api/rbac/v1alpha1/role_binding.rs index a2d7f085d2..b14abd0717 100644 --- a/src/v1_14/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_14/api/rbac/v1alpha1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_14::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_14::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -700,8 +766,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -715,8 +780,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -792,8 +869,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_14::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -815,8 +891,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -980,8 +1078,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1beta1/cluster_role.rs b/src/v1_14/api/rbac/v1beta1/cluster_role.rs index 978e64f8fd..25351d9002 100644 --- a/src/v1_14/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_14/api/rbac/v1beta1/cluster_role.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRole), Created(crate::v1_14::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_14::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleResponse { }; Ok((DeleteClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRole), Created(crate::v1_14::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_14/api/rbac/v1beta1/cluster_role_binding.rs index ed249e2229..f18fd3190f 100644 --- a/src/v1_14/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_14/api/rbac/v1beta1/cluster_role_binding.rs @@ -77,8 +77,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { }; Ok((DeleteClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -529,8 +572,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -585,8 +640,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -600,8 +654,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_14::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -695,8 +760,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -775,8 +851,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1beta1/role.rs b/src/v1_14/api/rbac/v1beta1/role.rs index ae286403ff..4175cdf5ef 100644 --- a/src/v1_14/api/rbac/v1beta1/role.rs +++ b/src/v1_14/api/rbac/v1beta1/role.rs @@ -79,8 +79,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::Role), Created(crate::v1_14::api::rbac::v1beta1::Role), Accepted(crate::v1_14::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -213,8 +224,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -241,8 +251,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -328,8 +350,7 @@ pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::Role), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -364,8 +385,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { }; Ok((DeleteNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -524,8 +568,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -539,8 +582,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -621,8 +676,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -636,8 +690,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -697,8 +763,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -712,8 +777,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -789,8 +866,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_14::api::rbac::v1beta1::Role), Created(crate::v1_14::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -812,8 +888,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -880,8 +968,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -897,8 +984,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -960,8 +1059,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -977,8 +1075,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/rbac/v1beta1/role_binding.rs b/src/v1_14/api/rbac/v1beta1/role_binding.rs index 573e32307c..8e3eec7419 100644 --- a/src/v1_14/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_14/api/rbac/v1beta1/role_binding.rs @@ -82,8 +82,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBinding), Created(crate::v1_14::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_14::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -113,8 +112,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -331,8 +353,7 @@ pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -367,8 +388,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { }; Ok((DeleteNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -442,8 +475,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -457,8 +489,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -527,8 +571,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -542,8 +585,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -624,8 +679,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -639,8 +693,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -700,8 +766,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -715,8 +780,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -792,8 +869,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_14::api::rbac::v1beta1::RoleBinding), Created(crate::v1_14::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -815,8 +891,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -883,8 +971,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -900,8 +987,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -963,8 +1062,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -980,8 +1078,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/scheduling/v1/priority_class.rs b/src/v1_14/api/scheduling/v1/priority_class.rs index bec5e05a15..87b5377e2a 100644 --- a/src/v1_14/api/scheduling/v1/priority_class.rs +++ b/src/v1_14/api/scheduling/v1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1::PriorityClass), Created(crate::v1_14::api::scheduling::v1::PriorityClass), Accepted(crate::v1_14::api::scheduling::v1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1::PriorityClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -517,8 +561,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -532,8 +575,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -600,8 +655,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -615,8 +669,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1::PriorityClass), Created(crate::v1_14::api::scheduling::v1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -710,8 +775,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -773,8 +850,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -790,8 +866,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/scheduling/v1alpha1/priority_class.rs b/src/v1_14/api/scheduling/v1alpha1/priority_class.rs index e39929c23e..c561b77a86 100644 --- a/src/v1_14/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_14/api/scheduling/v1alpha1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -517,8 +561,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -532,8 +575,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -600,8 +655,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -615,8 +669,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_14::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -710,8 +775,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -773,8 +850,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -790,8 +866,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/scheduling/v1beta1/priority_class.rs b/src/v1_14/api/scheduling/v1beta1/priority_class.rs index 223a0aeb46..6d96c62192 100644 --- a/src/v1_14/api/scheduling/v1beta1/priority_class.rs +++ b/src/v1_14/api/scheduling/v1beta1/priority_class.rs @@ -80,8 +80,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_14::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_14::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -111,8 +110,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -209,8 +220,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -237,8 +247,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub enum DeletePriorityClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::scheduling::v1beta1::PriorityClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -355,8 +376,20 @@ impl crate::Response for DeletePriorityClassResponse { }; Ok((DeletePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1beta1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -517,8 +561,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -532,8 +575,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -600,8 +655,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -615,8 +669,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_14::api::scheduling::v1beta1::PriorityClass), Created(crate::v1_14::api::scheduling::v1beta1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -710,8 +775,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -773,8 +850,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -790,8 +866,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/settings/v1alpha1/pod_preset.rs b/src/v1_14/api/settings/v1alpha1/pod_preset.rs index 0eb8d13bac..897832c558 100644 --- a/src/v1_14/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_14/api/settings/v1alpha1/pod_preset.rs @@ -77,8 +77,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPreset), Created(crate::v1_14::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_14::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -108,8 +107,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -326,8 +348,7 @@ pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -362,8 +383,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { }; Ok((DeleteNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -437,8 +470,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -452,8 +484,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -522,8 +566,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -537,8 +580,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -619,8 +674,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -634,8 +688,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -707,8 +773,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -722,8 +787,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -799,8 +876,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_14::api::settings::v1alpha1::PodPreset), Created(crate::v1_14::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -822,8 +898,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -890,8 +978,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -907,8 +994,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -970,8 +1069,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -987,8 +1085,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1/storage_class.rs b/src/v1_14/api/storage/v1/storage_class.rs index c42572eccc..8b4ce2fa50 100644 --- a/src/v1_14/api/storage/v1/storage_class.rs +++ b/src/v1_14/api/storage/v1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_14::api::storage::v1::StorageClass), Created(crate::v1_14::api::storage::v1::StorageClass), Accepted(crate::v1_14::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -223,8 +234,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -251,8 +261,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -333,8 +355,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1::StorageClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -369,8 +390,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_14::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -531,8 +575,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_14::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -546,8 +589,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -614,8 +669,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_14::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -629,8 +683,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -701,8 +767,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_14::api::storage::v1::StorageClass), Created(crate::v1_14::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -787,8 +864,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -804,8 +880,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1/volume_attachment.rs b/src/v1_14/api/storage/v1/volume_attachment.rs index df5941bb68..3b2067253c 100644 --- a/src/v1_14/api/storage/v1/volume_attachment.rs +++ b/src/v1_14/api/storage/v1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), Created(crate::v1_14::api::storage::v1::VolumeAttachment), Accepted(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1::VolumeAttachment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -354,8 +375,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -424,8 +457,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -439,8 +471,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -516,8 +560,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -531,8 +574,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -608,8 +663,7 @@ pub struct PatchVolumeAttachmentStatusOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentStatusResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentStatusResponse { @@ -623,8 +677,20 @@ impl crate::Response for PatchVolumeAttachmentStatusResponse { }; Ok((PatchVolumeAttachmentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -691,8 +757,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -706,8 +771,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReadVolumeAttachmentStatusOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentStatusResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentStatusResponse { @@ -777,8 +853,20 @@ impl crate::Response for ReadVolumeAttachmentStatusResponse { }; Ok((ReadVolumeAttachmentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), Created(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -872,8 +959,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -944,8 +1043,7 @@ pub struct ReplaceVolumeAttachmentStatusOptional<'a> { pub enum ReplaceVolumeAttachmentStatusResponse { Ok(crate::v1_14::api::storage::v1::VolumeAttachment), Created(crate::v1_14::api::storage::v1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentStatusResponse { @@ -967,8 +1065,20 @@ impl crate::Response for ReplaceVolumeAttachmentStatusResponse { }; Ok((ReplaceVolumeAttachmentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentStatusResponse::Other(result), read)) + }, } } } @@ -1030,8 +1140,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -1047,8 +1156,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1alpha1/volume_attachment.rs b/src/v1_14/api/storage/v1alpha1/volume_attachment.rs index d0e4b674c7..aec27fda14 100644 --- a/src/v1_14/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_14/api/storage/v1alpha1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -354,8 +375,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -424,8 +457,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -439,8 +471,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -516,8 +560,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -531,8 +574,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -599,8 +654,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -614,8 +668,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -686,8 +752,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_14::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -709,8 +774,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -772,8 +849,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -789,8 +865,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1beta1/csi_driver.rs b/src/v1_14/api/storage/v1beta1/csi_driver.rs index afaadb6825..69f4568e53 100644 --- a/src/v1_14/api/storage/v1beta1/csi_driver.rs +++ b/src/v1_14/api/storage/v1beta1/csi_driver.rs @@ -74,8 +74,7 @@ pub enum CreateCSIDriverResponse { Ok(crate::v1_14::api::storage::v1beta1::CSIDriver), Created(crate::v1_14::api::storage::v1beta1::CSIDriver), Accepted(crate::v1_14::api::storage::v1beta1::CSIDriver), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCSIDriverResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateCSIDriverResponse { }; Ok((CreateCSIDriverResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCSIDriverResponse::Unauthorized, 0)), - _ => Ok((CreateCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCSIDriverResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub enum DeleteCSIDriverResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::CSIDriver), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCSIDriverResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCSIDriverResponse { }; Ok((DeleteCSIDriverResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCSIDriverResponse::Unauthorized, 0)), - _ => Ok((DeleteCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCSIDriverResponse::Other(result), read)) + }, } } } @@ -321,8 +343,7 @@ pub struct DeleteCollectionCSIDriverOptional<'a> { pub enum DeleteCollectionCSIDriverResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::CSIDriver), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCSIDriverResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteCollectionCSIDriverResponse { Ok((DeleteCollectionCSIDriverResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCSIDriverResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCSIDriverResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl CSIDriver { #[derive(Debug)] pub enum ListCSIDriverResponse { Ok(crate::v1_14::api::storage::v1beta1::CSIDriverList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCSIDriverResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListCSIDriverResponse { }; Ok((ListCSIDriverResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCSIDriverResponse::Unauthorized, 0)), - _ => Ok((ListCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCSIDriverResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCSIDriverOptional<'a> { #[derive(Debug)] pub enum PatchCSIDriverResponse { Ok(crate::v1_14::api::storage::v1beta1::CSIDriver), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCSIDriverResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCSIDriverResponse { }; Ok((PatchCSIDriverResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCSIDriverResponse::Unauthorized, 0)), - _ => Ok((PatchCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCSIDriverResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadCSIDriverOptional<'a> { #[derive(Debug)] pub enum ReadCSIDriverResponse { Ok(crate::v1_14::api::storage::v1beta1::CSIDriver), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCSIDriverResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadCSIDriverResponse { }; Ok((ReadCSIDriverResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCSIDriverResponse::Unauthorized, 0)), - _ => Ok((ReadCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCSIDriverResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceCSIDriverOptional<'a> { pub enum ReplaceCSIDriverResponse { Ok(crate::v1_14::api::storage::v1beta1::CSIDriver), Created(crate::v1_14::api::storage::v1beta1::CSIDriver), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCSIDriverResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceCSIDriverResponse { }; Ok((ReplaceCSIDriverResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCSIDriverResponse::Unauthorized, 0)), - _ => Ok((ReplaceCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCSIDriverResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl CSIDriver { #[derive(Debug)] pub enum WatchCSIDriverResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCSIDriverResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchCSIDriverResponse { }; Ok((WatchCSIDriverResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCSIDriverResponse::Unauthorized, 0)), - _ => Ok((WatchCSIDriverResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCSIDriverResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1beta1/csi_node.rs b/src/v1_14/api/storage/v1beta1/csi_node.rs index ee97cd2c72..8d0bc55d32 100644 --- a/src/v1_14/api/storage/v1beta1/csi_node.rs +++ b/src/v1_14/api/storage/v1beta1/csi_node.rs @@ -74,8 +74,7 @@ pub enum CreateCSINodeResponse { Ok(crate::v1_14::api::storage::v1beta1::CSINode), Created(crate::v1_14::api::storage::v1beta1::CSINode), Accepted(crate::v1_14::api::storage::v1beta1::CSINode), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCSINodeResponse { @@ -105,8 +104,20 @@ impl crate::Response for CreateCSINodeResponse { }; Ok((CreateCSINodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCSINodeResponse::Unauthorized, 0)), - _ => Ok((CreateCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCSINodeResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub enum DeleteCSINodeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::CSINode), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCSINodeResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCSINodeResponse { }; Ok((DeleteCSINodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCSINodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCSINodeResponse::Other(result), read)) + }, } } } @@ -321,8 +343,7 @@ pub struct DeleteCollectionCSINodeOptional<'a> { pub enum DeleteCollectionCSINodeResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::CSINode), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCSINodeResponse { @@ -349,8 +370,20 @@ impl crate::Response for DeleteCollectionCSINodeResponse { Ok((DeleteCollectionCSINodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCSINodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCSINodeResponse::Other(result), read)) + }, } } } @@ -419,8 +452,7 @@ impl CSINode { #[derive(Debug)] pub enum ListCSINodeResponse { Ok(crate::v1_14::api::storage::v1beta1::CSINodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCSINodeResponse { @@ -434,8 +466,20 @@ impl crate::Response for ListCSINodeResponse { }; Ok((ListCSINodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCSINodeResponse::Unauthorized, 0)), - _ => Ok((ListCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCSINodeResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ pub struct PatchCSINodeOptional<'a> { #[derive(Debug)] pub enum PatchCSINodeResponse { Ok(crate::v1_14::api::storage::v1beta1::CSINode), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCSINodeResponse { @@ -526,8 +569,20 @@ impl crate::Response for PatchCSINodeResponse { }; Ok((PatchCSINodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCSINodeResponse::Unauthorized, 0)), - _ => Ok((PatchCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCSINodeResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct ReadCSINodeOptional<'a> { #[derive(Debug)] pub enum ReadCSINodeResponse { Ok(crate::v1_14::api::storage::v1beta1::CSINode), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCSINodeResponse { @@ -609,8 +663,20 @@ impl crate::Response for ReadCSINodeResponse { }; Ok((ReadCSINodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCSINodeResponse::Unauthorized, 0)), - _ => Ok((ReadCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCSINodeResponse::Other(result), read)) + }, } } } @@ -681,8 +747,7 @@ pub struct ReplaceCSINodeOptional<'a> { pub enum ReplaceCSINodeResponse { Ok(crate::v1_14::api::storage::v1beta1::CSINode), Created(crate::v1_14::api::storage::v1beta1::CSINode), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCSINodeResponse { @@ -704,8 +769,20 @@ impl crate::Response for ReplaceCSINodeResponse { }; Ok((ReplaceCSINodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCSINodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCSINodeResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ impl CSINode { #[derive(Debug)] pub enum WatchCSINodeResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCSINodeResponse { @@ -784,8 +860,20 @@ impl crate::Response for WatchCSINodeResponse { }; Ok((WatchCSINodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCSINodeResponse::Unauthorized, 0)), - _ => Ok((WatchCSINodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCSINodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1beta1/storage_class.rs b/src/v1_14/api/storage/v1beta1/storage_class.rs index 2ecad5bcd2..a1c3ca2fb3 100644 --- a/src/v1_14/api/storage/v1beta1/storage_class.rs +++ b/src/v1_14/api/storage/v1beta1/storage_class.rs @@ -94,8 +94,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_14::api::storage::v1beta1::StorageClass), Created(crate::v1_14::api::storage::v1beta1::StorageClass), Accepted(crate::v1_14::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -125,8 +124,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -223,8 +234,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -251,8 +261,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -333,8 +355,7 @@ pub enum DeleteStorageClassResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::StorageClass), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -369,8 +390,20 @@ impl crate::Response for DeleteStorageClassResponse { }; Ok((DeleteStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -439,8 +472,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_14::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -454,8 +486,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -531,8 +575,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_14::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -546,8 +589,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -614,8 +669,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_14::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -629,8 +683,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -701,8 +767,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_14::api::storage::v1beta1::StorageClass), Created(crate::v1_14::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -724,8 +789,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -787,8 +864,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -804,8 +880,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/api/storage/v1beta1/volume_attachment.rs b/src/v1_14/api/storage/v1beta1/volume_attachment.rs index 9619cc1c2c..cf6609843d 100644 --- a/src/v1_14/api/storage/v1beta1/volume_attachment.rs +++ b/src/v1_14/api/storage/v1beta1/volume_attachment.rs @@ -79,8 +79,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_14::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_14::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::api::storage::v1beta1::VolumeAttachment), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -354,8 +375,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { }; Ok((DeleteVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -424,8 +457,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1beta1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -439,8 +471,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -516,8 +560,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -531,8 +574,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -599,8 +654,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -614,8 +668,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -686,8 +752,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_14::api::storage::v1beta1::VolumeAttachment), Created(crate::v1_14::api::storage::v1beta1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -709,8 +774,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -772,8 +849,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -789,8 +865,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_14/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index abb4517169..a3addbc6e1 100644 --- a/src/v1_14/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_14/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -76,8 +76,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -351,8 +372,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { }; Ok((DeleteCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -421,8 +454,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -436,8 +468,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -513,8 +557,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -528,8 +571,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -605,8 +660,7 @@ pub struct PatchCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionStatusResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionStatusResponse { @@ -620,8 +674,20 @@ impl crate::Response for PatchCustomResourceDefinitionStatusResponse { }; Ok((PatchCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -688,8 +754,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -703,8 +768,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReadCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionStatusResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionStatusResponse { @@ -774,8 +850,20 @@ impl crate::Response for ReadCustomResourceDefinitionStatusResponse { }; Ok((ReadCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -869,8 +956,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_14::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -964,8 +1062,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -1027,8 +1137,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -1044,8 +1153,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs b/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs index 0e9b895891..412f42491d 100644 --- a/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs +++ b/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -323,8 +345,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -351,8 +372,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -421,8 +454,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -436,8 +468,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -513,8 +557,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -528,8 +571,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -605,8 +660,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -620,8 +674,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -688,8 +754,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -703,8 +768,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -774,8 +850,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -869,8 +956,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -964,8 +1062,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1027,8 +1137,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1044,8 +1153,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 30cd55cc43..2f3a958f2e 100644 --- a/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_14/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -76,8 +76,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -107,8 +106,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteAPIServiceResponse { }; Ok((DeleteAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -323,8 +345,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_14::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -351,8 +372,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -421,8 +454,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -436,8 +468,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -513,8 +557,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -528,8 +571,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -605,8 +660,7 @@ pub struct PatchAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceStatusResponse { @@ -620,8 +674,20 @@ impl crate::Response for PatchAPIServiceStatusResponse { }; Ok((PatchAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -688,8 +754,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -703,8 +768,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReadAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceStatusResponse { @@ -774,8 +850,20 @@ impl crate::Response for ReadAPIServiceStatusResponse { }; Ok((ReadAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -869,8 +956,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_14::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -964,8 +1062,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -1027,8 +1137,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -1044,8 +1153,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_14/mod.rs b/src/v1_14/mod.rs index 8e2f265b44..603495196a 100644 --- a/src/v1_14/mod.rs +++ b/src/v1_14/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_v1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1APIResourcesResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationV1APIResourcesResponse { }; Ok((GetApiregistrationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_auditregistration_api_group( #[derive(Debug)] pub enum GetAuditregistrationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuditregistrationAPIGroupResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAuditregistrationAPIGroupResponse { }; Ok((GetAuditregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuditregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuditregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuditregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_auditregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAuditregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuditregistrationV1alpha1APIResourcesResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuditregistrationV1alpha1APIResourcesResponse { }; Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuditregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_autoscaling_v2beta2_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta2APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetAutoscalingV2beta2APIResourcesResponse { }; Ok((GetAutoscalingV2beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_14::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_coordination_api_group( #[derive(Debug)] pub enum GetCoordinationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationAPIGroupResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetCoordinationAPIGroupResponse { }; Ok((GetCoordinationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_coordination_v1_api_resources( #[derive(Debug)] pub enum GetCoordinationV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationV1APIResourcesResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetCoordinationV1APIResourcesResponse { }; Ok((GetCoordinationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_coordination_v1beta1_api_resources( #[derive(Debug)] pub enum GetCoordinationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetCoordinationV1beta1APIResourcesResponse { }; Ok((GetCoordinationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoordinationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoordinationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoordinationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_networking_v1beta1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1beta1APIResourcesResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetNetworkingV1beta1APIResourcesResponse { }; Ok((GetNetworkingV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_node_api_group( #[derive(Debug)] pub enum GetNodeAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNodeAPIGroupResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetNodeAPIGroupResponse { }; Ok((GetNodeAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNodeAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNodeAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNodeAPIGroupResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_node_v1alpha1_api_resources( #[derive(Debug)] pub enum GetNodeV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNodeV1alpha1APIResourcesResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetNodeV1alpha1APIResourcesResponse { }; Ok((GetNodeV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNodeV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNodeV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNodeV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_node_v1beta1_api_resources( #[derive(Debug)] pub enum GetNodeV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNodeV1beta1APIResourcesResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetNodeV1beta1APIResourcesResponse { }; Ok((GetNodeV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNodeV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNodeV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNodeV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2138,8 +2688,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -2153,8 +2702,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2180,8 +2741,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -2195,8 +2755,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2222,8 +2794,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -2237,8 +2808,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -2264,8 +2847,7 @@ pub fn get_scheduling_v1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1APIResourcesResponse { @@ -2279,8 +2861,20 @@ impl crate::Response for GetSchedulingV1APIResourcesResponse { }; Ok((GetSchedulingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2306,8 +2900,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -2321,8 +2914,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2348,8 +2953,7 @@ pub fn get_scheduling_v1beta1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { @@ -2363,8 +2967,20 @@ impl crate::Response for GetSchedulingV1beta1APIResourcesResponse { }; Ok((GetSchedulingV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2390,8 +3006,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -2405,8 +3020,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -2432,8 +3059,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -2447,8 +3073,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2474,8 +3112,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -2489,8 +3126,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2516,8 +3165,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2531,8 +3179,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2558,8 +3218,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2573,8 +3232,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2600,8 +3271,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_14::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2615,8 +3285,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2646,15 +3328,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2677,15 +3370,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/admissionregistration/v1alpha1/external_admission_hook_configuration.rs b/src/v1_8/api/admissionregistration/v1alpha1/external_admission_hook_configuration.rs index 784901ef7e..5f395b295a 100644 --- a/src/v1_8/api/admissionregistration/v1alpha1/external_admission_hook_configuration.rs +++ b/src/v1_8/api/admissionregistration/v1alpha1/external_admission_hook_configuration.rs @@ -60,8 +60,7 @@ pub struct CreateExternalAdmissionHookConfigurationOptional<'a> { #[derive(Debug)] pub enum CreateExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateExternalAdmissionHookConfigurationResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreateExternalAdmissionHookConfigurationResponse { }; Ok((CreateExternalAdmissionHookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -177,8 +188,7 @@ pub struct DeleteCollectionExternalAdmissionHookConfigurationOptional<'a> { pub enum DeleteCollectionExternalAdmissionHookConfigurationResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionExternalAdmissionHookConfigurationResponse { @@ -205,8 +215,20 @@ impl crate::Response for DeleteCollectionExternalAdmissionHookConfigurationRespo Ok((DeleteCollectionExternalAdmissionHookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeleteExternalAdmissionHookConfigurationOptional<'a> { pub enum DeleteExternalAdmissionHookConfigurationResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteExternalAdmissionHookConfigurationResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeleteExternalAdmissionHookConfigurationResponse { Ok((DeleteExternalAdmissionHookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl ExternalAdmissionHookConfiguration { #[derive(Debug)] pub enum ListExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListExternalAdmissionHookConfigurationResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListExternalAdmissionHookConfigurationResponse { }; Ok((ListExternalAdmissionHookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchExternalAdmissionHookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchExternalAdmissionHookConfigurationResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchExternalAdmissionHookConfigurationResponse { }; Ok((PatchExternalAdmissionHookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -539,8 +594,7 @@ pub struct ReadExternalAdmissionHookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadExternalAdmissionHookConfigurationResponse { @@ -554,8 +608,20 @@ impl crate::Response for ReadExternalAdmissionHookConfigurationResponse { }; Ok((ReadExternalAdmissionHookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -613,8 +679,7 @@ pub struct ReplaceExternalAdmissionHookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReplaceExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::ExternalAdmissionHookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceExternalAdmissionHookConfigurationResponse { @@ -628,8 +693,20 @@ impl crate::Response for ReplaceExternalAdmissionHookConfigurationResponse { }; Ok((ReplaceExternalAdmissionHookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } @@ -695,8 +772,7 @@ impl ExternalAdmissionHookConfiguration { #[derive(Debug)] pub enum WatchExternalAdmissionHookConfigurationResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchExternalAdmissionHookConfigurationResponse { @@ -712,8 +788,20 @@ impl crate::Response for WatchExternalAdmissionHookConfigurationResponse { }; Ok((WatchExternalAdmissionHookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchExternalAdmissionHookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchExternalAdmissionHookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchExternalAdmissionHookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_8/api/admissionregistration/v1alpha1/initializer_configuration.rs index 0a59d0cb4f..79208c1b54 100644 --- a/src/v1_8/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_8/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -60,8 +60,7 @@ pub struct CreateInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -177,8 +188,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -205,8 +215,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeleteInitializerConfigurationOptional<'a> { pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { Ok((DeleteInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -539,8 +594,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -554,8 +608,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -613,8 +679,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_8::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -628,8 +693,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -695,8 +772,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -712,8 +788,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta1/controller_revision.rs b/src/v1_8/api/apps/v1beta1/controller_revision.rs index 72364bbd44..20e844f289 100644 --- a/src/v1_8/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_8/api/apps/v1beta1/controller_revision.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -661,8 +727,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -676,8 +741,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -822,8 +910,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -839,8 +926,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -911,8 +1010,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -928,8 +1026,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta1/deployment.rs b/src/v1_8/api/apps/v1beta1/deployment.rs index d7fb7db380..59831b9f2f 100644 --- a/src/v1_8/api/apps/v1beta1/deployment.rs +++ b/src/v1_8/api/apps/v1beta1/deployment.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta1/deployment_rollback.rs b/src/v1_8/api/apps/v1beta1/deployment_rollback.rs index 0011d3d229..2323d00f3b 100644 --- a/src/v1_8/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_8/api/apps/v1beta1/deployment_rollback.rs @@ -73,8 +73,7 @@ pub struct CreateNamespacedDeploymentRollbackOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -88,8 +87,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta1/scale.rs b/src/v1_8/api/apps/v1beta1/scale.rs index e2da4bf7a8..4f5fa09711 100644 --- a/src/v1_8/api/apps/v1beta1/scale.rs +++ b/src/v1_8/api/apps/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -228,8 +250,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -243,8 +264,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -304,8 +337,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -319,8 +351,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -462,8 +517,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -477,8 +531,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta1/stateful_set.rs b/src/v1_8/api/apps/v1beta1/stateful_set.rs index 3f389cb40a..962981ee2a 100644 --- a/src/v1_8/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_8/api/apps/v1beta1/stateful_set.rs @@ -70,8 +70,7 @@ pub struct CreateNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -85,8 +84,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -192,8 +203,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -220,8 +230,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -407,8 +440,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -422,8 +454,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -496,8 +540,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -511,8 +554,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -575,8 +630,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -590,8 +644,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -654,8 +720,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -669,8 +734,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -742,8 +819,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -757,8 +833,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -818,8 +906,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -833,8 +920,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -897,8 +996,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -912,8 +1010,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -976,8 +1086,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -991,8 +1100,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1063,8 +1184,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1080,8 +1200,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1147,8 +1279,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1164,8 +1295,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/controller_revision.rs b/src/v1_8/api/apps/v1beta2/controller_revision.rs index b2178714e6..3f2f2c7254 100644 --- a/src/v1_8/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_8/api/apps/v1beta2/controller_revision.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -661,8 +727,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -676,8 +741,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_8::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -822,8 +910,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -839,8 +926,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -911,8 +1010,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -928,8 +1026,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/daemon_set.rs b/src/v1_8/api/apps/v1beta2/daemon_set.rs index 063a4e756e..0496dd1460 100644 --- a/src/v1_8/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_8/api/apps/v1beta2/daemon_set.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/deployment.rs b/src/v1_8/api/apps/v1beta2/deployment.rs index 533c919b94..d8514585ec 100644 --- a/src/v1_8/api/apps/v1beta2/deployment.rs +++ b/src/v1_8/api/apps/v1beta2/deployment.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/replica_set.rs b/src/v1_8/api/apps/v1beta2/replica_set.rs index 1cfc877345..ac1c86681f 100644 --- a/src/v1_8/api/apps/v1beta2/replica_set.rs +++ b/src/v1_8/api/apps/v1beta2/replica_set.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1061,8 +1182,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1078,8 +1198,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/scale.rs b/src/v1_8/api/apps/v1beta2/scale.rs index da1707cf62..dcf0cc3632 100644 --- a/src/v1_8/api/apps/v1beta2/scale.rs +++ b/src/v1_8/api/apps/v1beta2/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -538,8 +604,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -553,8 +618,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -617,8 +694,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -632,8 +708,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -696,8 +784,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_8::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -711,8 +798,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/apps/v1beta2/stateful_set.rs b/src/v1_8/api/apps/v1beta2/stateful_set.rs index c471e110a9..f28be99f1b 100644 --- a/src/v1_8/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_8/api/apps/v1beta2/stateful_set.rs @@ -70,8 +70,7 @@ pub struct CreateNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -85,8 +84,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -192,8 +203,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -220,8 +230,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -407,8 +440,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -422,8 +454,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -496,8 +540,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -511,8 +554,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -575,8 +630,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -590,8 +644,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -654,8 +720,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -669,8 +734,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -742,8 +819,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -757,8 +833,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -818,8 +906,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -833,8 +920,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -897,8 +996,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -912,8 +1010,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -976,8 +1086,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_8::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -991,8 +1100,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1063,8 +1184,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1080,8 +1200,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1147,8 +1279,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1164,8 +1295,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authentication/v1/token_review.rs b/src/v1_8/api/authentication/v1/token_review.rs index 8b141dc970..29995f6084 100644 --- a/src/v1_8/api/authentication/v1/token_review.rs +++ b/src/v1_8/api/authentication/v1/token_review.rs @@ -62,8 +62,7 @@ pub struct CreateTokenReviewOptional<'a> { #[derive(Debug)] pub enum CreateTokenReviewResponse { Ok(crate::v1_8::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authentication/v1beta1/token_review.rs b/src/v1_8/api/authentication/v1beta1/token_review.rs index 1c82f21493..eb5bbcf6b4 100644 --- a/src/v1_8/api/authentication/v1beta1/token_review.rs +++ b/src/v1_8/api/authentication/v1beta1/token_review.rs @@ -62,8 +62,7 @@ pub struct CreateTokenReviewOptional<'a> { #[derive(Debug)] pub enum CreateTokenReviewResponse { Ok(crate::v1_8::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1/local_subject_access_review.rs b/src/v1_8/api/authorization/v1/local_subject_access_review.rs index c718b98661..1b49956bca 100644 --- a/src/v1_8/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_8/api/authorization/v1/local_subject_access_review.rs @@ -67,8 +67,7 @@ pub struct CreateNamespacedLocalSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -82,8 +81,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1/self_subject_access_review.rs b/src/v1_8/api/authorization/v1/self_subject_access_review.rs index 81fb8c5621..fcb6ed3b90 100644 --- a/src/v1_8/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_8/api/authorization/v1/self_subject_access_review.rs @@ -62,8 +62,7 @@ pub struct CreateSelfSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1/self_subject_rules_review.rs b/src/v1_8/api/authorization/v1/self_subject_rules_review.rs index 831d7e431d..6ebd5d1abe 100644 --- a/src/v1_8/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_8/api/authorization/v1/self_subject_rules_review.rs @@ -62,8 +62,7 @@ pub struct CreateSelfSubjectRulesReviewOptional<'a> { #[derive(Debug)] pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_8::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1/subject_access_review.rs b/src/v1_8/api/authorization/v1/subject_access_review.rs index 43341f80ea..292a8c8318 100644 --- a/src/v1_8/api/authorization/v1/subject_access_review.rs +++ b/src/v1_8/api/authorization/v1/subject_access_review.rs @@ -62,8 +62,7 @@ pub struct CreateSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_8/api/authorization/v1beta1/local_subject_access_review.rs index 9b4d105f84..d54480a458 100644 --- a/src/v1_8/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_8/api/authorization/v1beta1/local_subject_access_review.rs @@ -67,8 +67,7 @@ pub struct CreateNamespacedLocalSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -82,8 +81,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_8/api/authorization/v1beta1/self_subject_access_review.rs index 0d4d0fc3a0..cbd9b29ae5 100644 --- a/src/v1_8/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_8/api/authorization/v1beta1/self_subject_access_review.rs @@ -62,8 +62,7 @@ pub struct CreateSelfSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_8/api/authorization/v1beta1/self_subject_rules_review.rs index f7daf8b3b4..d2d23d716a 100644 --- a/src/v1_8/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_8/api/authorization/v1beta1/self_subject_rules_review.rs @@ -62,8 +62,7 @@ pub struct CreateSelfSubjectRulesReviewOptional<'a> { #[derive(Debug)] pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_8::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/authorization/v1beta1/subject_access_review.rs b/src/v1_8/api/authorization/v1beta1/subject_access_review.rs index 63316517cf..be580013c1 100644 --- a/src/v1_8/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_8/api/authorization/v1beta1/subject_access_review.rs @@ -62,8 +62,7 @@ pub struct CreateSubjectAccessReviewOptional<'a> { #[derive(Debug)] pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_8::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_8/api/autoscaling/v1/horizontal_pod_autoscaler.rs index 882e6eeae9..62237bcc91 100644 --- a/src/v1_8/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_8/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/autoscaling/v1/scale.rs b/src/v1_8/api/autoscaling/v1/scale.rs index d10a4278a0..6a882a4079 100644 --- a/src/v1_8/api/autoscaling/v1/scale.rs +++ b/src/v1_8/api/autoscaling/v1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_8::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -149,8 +160,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_8::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -164,8 +174,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -228,8 +250,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_8::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -243,8 +264,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_8/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index cedfa705c8..9eb10c9f47 100644 --- a/src/v1_8/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_8/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_8::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/batch/v1/job.rs b/src/v1_8/api/batch/v1/job.rs index 8ef8255d43..b3e9cebb9e 100644 --- a/src/v1_8/api/batch/v1/job.rs +++ b/src/v1_8/api/batch/v1/job.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedJobOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedJobResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedJobOptional<'a> { pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedJobResponse { Ok((DeleteNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_8::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_8::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_8::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/batch/v1beta1/cron_job.rs b/src/v1_8/api/batch/v1beta1/cron_job.rs index 3ef64d32f4..dcf5dbf665 100644 --- a/src/v1_8/api/batch/v1beta1/cron_job.rs +++ b/src/v1_8/api/batch/v1beta1/cron_job.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/batch/v2alpha1/cron_job.rs b/src/v1_8/api/batch/v2alpha1/cron_job.rs index dcc464817f..fd85ccd47d 100644 --- a/src/v1_8/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_8/api/batch/v2alpha1/cron_job.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_8::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_8/api/certificates/v1beta1/certificate_signing_request.rs index 44fd0ac0c4..740fb8f735 100644 --- a/src/v1_8/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_8/api/certificates/v1beta1/certificate_signing_request.rs @@ -62,8 +62,7 @@ pub struct CreateCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct DeleteCertificateSigningRequestOptional<'a> { pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -180,8 +190,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { Ok((DeleteCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -282,8 +304,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -310,8 +331,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -384,8 +417,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -399,8 +431,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -458,8 +502,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -473,8 +516,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -541,8 +596,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -556,8 +610,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -615,8 +681,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -630,8 +695,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -689,8 +766,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { #[derive(Debug)] pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -704,8 +780,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -763,8 +851,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_8::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -778,8 +865,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -845,8 +944,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -862,8 +960,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/binding.rs b/src/v1_8/api/core/v1/binding.rs index 20e4fa4b1f..30751be8d8 100644 --- a/src/v1_8/api/core/v1/binding.rs +++ b/src/v1_8/api/core/v1/binding.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedBindingOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedBindingResponse { Ok(crate::v1_8::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -144,8 +155,7 @@ pub struct CreateNamespacedPodBindingOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_8::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -159,8 +169,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/component_status.rs b/src/v1_8/api/core/v1/component_status.rs index 8ddf907b13..0f75a5b4fb 100644 --- a/src/v1_8/api/core/v1/component_status.rs +++ b/src/v1_8/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_8::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_8::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/config_map.rs b/src/v1_8/api/core/v1/config_map.rs index d82e6e4176..d5455c2cf4 100644 --- a/src/v1_8/api/core/v1/config_map.rs +++ b/src/v1_8/api/core/v1/config_map.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedConfigMapOptional<'a> { pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { Ok((DeleteNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -397,8 +430,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -412,8 +444,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_8::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -658,8 +724,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -673,8 +738,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -737,8 +814,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_8::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -752,8 +828,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -819,8 +907,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -836,8 +923,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -908,8 +1007,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -925,8 +1023,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/endpoints.rs b/src/v1_8/api/core/v1/endpoints.rs index 4cfddd82d7..d517c54da1 100644 --- a/src/v1_8/api/core/v1/endpoints.rs +++ b/src/v1_8/api/core/v1/endpoints.rs @@ -76,8 +76,7 @@ pub struct CreateNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -91,8 +90,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -198,8 +209,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -306,8 +328,7 @@ pub struct DeleteNamespacedEndpointsOptional<'a> { pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -334,8 +355,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { Ok((DeleteNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -408,8 +441,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -423,8 +455,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -502,8 +546,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_8::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -517,8 +560,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -581,8 +636,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -596,8 +650,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -669,8 +735,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -684,8 +749,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -748,8 +825,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_8::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -763,8 +839,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -830,8 +918,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -847,8 +934,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -919,8 +1018,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -936,8 +1034,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/event.rs b/src/v1_8/api/core/v1/event.rs index 39b39c9261..f13c6cf672 100644 --- a/src/v1_8/api/core/v1/event.rs +++ b/src/v1_8/api/core/v1/event.rs @@ -86,8 +86,7 @@ pub struct CreateNamespacedEventOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedEventResponse { Ok(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_8::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_8::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -840,8 +928,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -857,8 +944,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -929,8 +1028,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -946,8 +1044,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/limit_range.rs b/src/v1_8/api/core/v1/limit_range.rs index 4bc5ab13ef..3978989678 100644 --- a/src/v1_8/api/core/v1/limit_range.rs +++ b/src/v1_8/api/core/v1/limit_range.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedLimitRangeOptional<'a> { pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { Ok((DeleteNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -397,8 +430,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -412,8 +444,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_8::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -658,8 +724,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -673,8 +738,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -737,8 +814,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_8::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -752,8 +828,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -819,8 +907,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -836,8 +923,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -908,8 +1007,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -925,8 +1023,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/namespace.rs b/src/v1_8/api/core/v1/namespace.rs index f3ef2db2a9..0fcdfce33b 100644 --- a/src/v1_8/api/core/v1/namespace.rs +++ b/src/v1_8/api/core/v1/namespace.rs @@ -63,8 +63,7 @@ pub struct CreateNamespaceOptional<'a> { #[derive(Debug)] pub enum CreateNamespaceResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -153,8 +164,7 @@ pub struct DeleteNamespaceOptional<'a> { pub enum DeleteNamespaceResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -181,8 +191,20 @@ impl crate::Response for DeleteNamespaceResponse { Ok((DeleteNamespaceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -255,8 +277,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_8::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -270,8 +291,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -329,8 +362,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -344,8 +376,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -403,8 +447,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -418,8 +461,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -486,8 +541,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -501,8 +555,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -557,8 +623,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -572,8 +637,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -631,8 +708,7 @@ pub struct ReplaceNamespaceOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespaceResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -646,8 +722,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -705,8 +793,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -720,8 +807,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -779,8 +878,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_8::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -794,8 +892,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -861,8 +971,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -878,8 +987,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/node.rs b/src/v1_8/api/core/v1/node.rs index a3ad4527e1..485c3a4829 100644 --- a/src/v1_8/api/core/v1/node.rs +++ b/src/v1_8/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -898,8 +1008,7 @@ pub struct CreateNodeOptional<'a> { #[derive(Debug)] pub enum CreateNodeResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -913,8 +1022,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1015,8 +1136,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1043,8 +1163,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1118,8 +1250,7 @@ pub struct DeleteNodeOptional<'a> { pub enum DeleteNodeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1146,8 +1277,20 @@ impl crate::Response for DeleteNodeResponse { Ok((DeleteNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1220,8 +1363,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_8::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1235,8 +1377,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1294,8 +1448,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1309,8 +1462,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1368,8 +1533,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1383,8 +1547,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1419,8 +1595,7 @@ impl Node { #[derive(Debug)] pub enum ProxyDELETENodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENodeResponse { @@ -1444,8 +1619,20 @@ impl crate::Response for ProxyDELETENodeResponse { }; Ok((ProxyDELETENodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENodeResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENodeResponse::Other(result), read)) + }, } } } @@ -1485,8 +1672,7 @@ impl Node { #[derive(Debug)] pub enum ProxyDELETENodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENodeWithPathResponse { @@ -1510,8 +1696,20 @@ impl crate::Response for ProxyDELETENodeWithPathResponse { }; Ok((ProxyDELETENodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENodeWithPathResponse::Other(result), read)) + }, } } } @@ -1546,8 +1744,7 @@ impl Node { #[derive(Debug)] pub enum ProxyGETNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNodeResponse { @@ -1571,8 +1768,20 @@ impl crate::Response for ProxyGETNodeResponse { }; Ok((ProxyGETNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNodeResponse::Other(result), read)) + }, } } } @@ -1612,8 +1821,7 @@ impl Node { #[derive(Debug)] pub enum ProxyGETNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNodeWithPathResponse { @@ -1637,8 +1845,20 @@ impl crate::Response for ProxyGETNodeWithPathResponse { }; Ok((ProxyGETNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1673,8 +1893,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPATCHNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNodeResponse { @@ -1698,8 +1917,20 @@ impl crate::Response for ProxyPATCHNodeResponse { }; Ok((ProxyPATCHNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNodeResponse::Other(result), read)) + }, } } } @@ -1739,8 +1970,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPATCHNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNodeWithPathResponse { @@ -1764,8 +1994,20 @@ impl crate::Response for ProxyPATCHNodeWithPathResponse { }; Ok((ProxyPATCHNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1800,8 +2042,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPOSTNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNodeResponse { @@ -1825,8 +2066,20 @@ impl crate::Response for ProxyPOSTNodeResponse { }; Ok((ProxyPOSTNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNodeResponse::Other(result), read)) + }, } } } @@ -1866,8 +2119,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPOSTNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNodeWithPathResponse { @@ -1891,8 +2143,20 @@ impl crate::Response for ProxyPOSTNodeWithPathResponse { }; Ok((ProxyPOSTNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1927,8 +2191,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPUTNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNodeResponse { @@ -1952,8 +2215,20 @@ impl crate::Response for ProxyPUTNodeResponse { }; Ok((ProxyPUTNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNodeResponse::Other(result), read)) + }, } } } @@ -1993,8 +2268,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPUTNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNodeWithPathResponse { @@ -2018,8 +2292,20 @@ impl crate::Response for ProxyPUTNodeWithPathResponse { }; Ok((ProxyPUTNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNodeWithPathResponse::Other(result), read)) + }, } } } @@ -2086,8 +2372,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -2101,8 +2386,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -2157,8 +2454,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -2172,8 +2468,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -2231,8 +2539,7 @@ pub struct ReplaceNodeOptional<'a> { #[derive(Debug)] pub enum ReplaceNodeResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -2246,8 +2553,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -2305,8 +2624,7 @@ pub struct ReplaceNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNodeStatusResponse { Ok(crate::v1_8::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -2320,8 +2638,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -2387,8 +2717,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -2404,8 +2733,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/persistent_volume.rs b/src/v1_8/api/core/v1/persistent_volume.rs index f605e18d63..9877709da0 100644 --- a/src/v1_8/api/core/v1/persistent_volume.rs +++ b/src/v1_8/api/core/v1/persistent_volume.rs @@ -63,8 +63,7 @@ pub struct CreatePersistentVolumeOptional<'a> { #[derive(Debug)] pub enum CreatePersistentVolumeResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -180,8 +191,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -208,8 +218,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -283,8 +305,7 @@ pub struct DeletePersistentVolumeOptional<'a> { pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -311,8 +332,20 @@ impl crate::Response for DeletePersistentVolumeResponse { Ok((DeletePersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -385,8 +418,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -400,8 +432,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -459,8 +503,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -474,8 +517,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -533,8 +588,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -548,8 +602,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -616,8 +682,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -631,8 +696,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -687,8 +764,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -702,8 +778,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -761,8 +849,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -776,8 +863,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -835,8 +934,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -850,8 +948,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -917,8 +1027,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -934,8 +1043,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/persistent_volume_claim.rs b/src/v1_8/api/core/v1/persistent_volume_claim.rs index 43551e48c7..c879f66118 100644 --- a/src/v1_8/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_8/api/core/v1/persistent_volume_claim.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { Ok((DeleteNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_8::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1061,8 +1182,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1078,8 +1198,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/pod.rs b/src/v1_8/api/core/v1/pod.rs index b2b53c77b5..17c4c6948a 100644 --- a/src/v1_8/api/core/v1/pod.rs +++ b/src/v1_8/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1577,8 +1753,7 @@ pub struct CreateNamespacedPodOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1592,8 +1767,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1699,8 +1886,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1727,8 +1913,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1807,8 +2005,7 @@ pub struct DeleteNamespacedPodOptional<'a> { pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1835,8 +2032,20 @@ impl crate::Response for DeleteNamespacedPodResponse { Ok((DeleteNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1914,8 +2123,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_8::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1929,8 +2137,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2003,8 +2223,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2018,8 +2237,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2082,8 +2313,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2097,8 +2327,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2161,8 +2403,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2176,8 +2417,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2217,8 +2470,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyDELETENamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedPodResponse { @@ -2242,8 +2494,20 @@ impl crate::Response for ProxyDELETENamespacedPodResponse { }; Ok((ProxyDELETENamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedPodResponse::Other(result), read)) + }, } } } @@ -2288,8 +2552,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyDELETENamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedPodWithPathResponse { @@ -2313,8 +2576,20 @@ impl crate::Response for ProxyDELETENamespacedPodWithPathResponse { }; Ok((ProxyDELETENamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2354,8 +2629,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyGETNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedPodResponse { @@ -2379,8 +2653,20 @@ impl crate::Response for ProxyGETNamespacedPodResponse { }; Ok((ProxyGETNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2425,8 +2711,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyGETNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedPodWithPathResponse { @@ -2450,8 +2735,20 @@ impl crate::Response for ProxyGETNamespacedPodWithPathResponse { }; Ok((ProxyGETNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2491,8 +2788,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPATCHNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedPodResponse { @@ -2516,8 +2812,20 @@ impl crate::Response for ProxyPATCHNamespacedPodResponse { }; Ok((ProxyPATCHNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2562,8 +2870,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPATCHNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedPodWithPathResponse { @@ -2587,8 +2894,20 @@ impl crate::Response for ProxyPATCHNamespacedPodWithPathResponse { }; Ok((ProxyPATCHNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2628,8 +2947,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPOSTNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedPodResponse { @@ -2653,8 +2971,20 @@ impl crate::Response for ProxyPOSTNamespacedPodResponse { }; Ok((ProxyPOSTNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2699,8 +3029,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPOSTNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedPodWithPathResponse { @@ -2724,8 +3053,20 @@ impl crate::Response for ProxyPOSTNamespacedPodWithPathResponse { }; Ok((ProxyPOSTNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2765,8 +3106,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPUTNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedPodResponse { @@ -2790,8 +3130,20 @@ impl crate::Response for ProxyPUTNamespacedPodResponse { }; Ok((ProxyPUTNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2836,8 +3188,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPUTNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedPodWithPathResponse { @@ -2861,8 +3212,20 @@ impl crate::Response for ProxyPUTNamespacedPodWithPathResponse { }; Ok((ProxyPUTNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2934,8 +3297,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2949,8 +3311,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3052,8 +3426,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -3077,8 +3450,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -3138,8 +3523,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -3153,8 +3537,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -3217,8 +3613,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -3232,8 +3627,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3296,8 +3703,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_8::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -3311,8 +3717,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -3383,8 +3801,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -3400,8 +3817,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3467,8 +3896,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -3484,8 +3912,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/pod_template.rs b/src/v1_8/api/core/v1/pod_template.rs index 245966e149..b71e6b5f46 100644 --- a/src/v1_8/api/core/v1/pod_template.rs +++ b/src/v1_8/api/core/v1/pod_template.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedPodTemplateOptional<'a> { pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { Ok((DeleteNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_8::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -658,8 +724,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -673,8 +738,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -737,8 +814,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_8::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -752,8 +828,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -824,8 +912,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -841,8 +928,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -908,8 +1007,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -925,8 +1023,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/replication_controller.rs b/src/v1_8/api/core/v1/replication_controller.rs index c5f4209a93..6d78ea5ffc 100644 --- a/src/v1_8/api/core/v1/replication_controller.rs +++ b/src/v1_8/api/core/v1/replication_controller.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedReplicationControllerOptional<'a> { pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { Ok((DeleteNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_8::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_8::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1061,8 +1182,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1078,8 +1198,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/resource_quota.rs b/src/v1_8/api/core/v1/resource_quota.rs index d74116bf04..0158ee61db 100644 --- a/src/v1_8/api/core/v1/resource_quota.rs +++ b/src/v1_8/api/core/v1/resource_quota.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedResourceQuotaOptional<'a> { pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { Ok((DeleteNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_8::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_8::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1061,8 +1182,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1078,8 +1198,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/secret.rs b/src/v1_8/api/core/v1/secret.rs index 9554ce8eb8..9d203e1892 100644 --- a/src/v1_8/api/core/v1/secret.rs +++ b/src/v1_8/api/core/v1/secret.rs @@ -71,8 +71,7 @@ pub struct CreateNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedSecretResponse { Ok(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -86,8 +85,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -193,8 +204,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -221,8 +231,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteNamespacedSecretOptional<'a> { pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { Ok((DeleteNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -408,8 +441,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_8::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -423,8 +455,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -497,8 +541,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -512,8 +555,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -576,8 +631,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -591,8 +645,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -743,8 +820,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_8::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -758,8 +834,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -830,8 +918,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -847,8 +934,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -931,8 +1029,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/service.rs b/src/v1_8/api/core/v1/service.rs index b1f8e9d589..f6efba164c 100644 --- a/src/v1_8/api/core/v1/service.rs +++ b/src/v1_8/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -953,8 +1063,7 @@ pub struct CreateNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedServiceResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -968,8 +1077,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1030,8 +1151,7 @@ pub struct DeleteNamespacedServiceOptional<'a> { pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1058,8 +1178,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { Ok((DeleteNamespacedServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1137,8 +1269,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_8::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1152,8 +1283,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1226,8 +1369,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1241,8 +1383,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1305,8 +1459,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1320,8 +1473,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1384,8 +1549,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1399,8 +1563,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1440,8 +1616,7 @@ impl Service { #[derive(Debug)] pub enum ProxyDELETENamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedServiceResponse { @@ -1465,8 +1640,20 @@ impl crate::Response for ProxyDELETENamespacedServiceResponse { }; Ok((ProxyDELETENamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1511,8 +1698,7 @@ impl Service { #[derive(Debug)] pub enum ProxyDELETENamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedServiceWithPathResponse { @@ -1536,8 +1722,20 @@ impl crate::Response for ProxyDELETENamespacedServiceWithPathResponse { }; Ok((ProxyDELETENamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1577,8 +1775,7 @@ impl Service { #[derive(Debug)] pub enum ProxyGETNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedServiceResponse { @@ -1602,8 +1799,20 @@ impl crate::Response for ProxyGETNamespacedServiceResponse { }; Ok((ProxyGETNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1648,8 +1857,7 @@ impl Service { #[derive(Debug)] pub enum ProxyGETNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedServiceWithPathResponse { @@ -1673,8 +1881,20 @@ impl crate::Response for ProxyGETNamespacedServiceWithPathResponse { }; Ok((ProxyGETNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1714,8 +1934,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPATCHNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedServiceResponse { @@ -1739,8 +1958,20 @@ impl crate::Response for ProxyPATCHNamespacedServiceResponse { }; Ok((ProxyPATCHNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1785,8 +2016,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPATCHNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedServiceWithPathResponse { @@ -1810,8 +2040,20 @@ impl crate::Response for ProxyPATCHNamespacedServiceWithPathResponse { }; Ok((ProxyPATCHNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1851,8 +2093,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPOSTNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedServiceResponse { @@ -1876,8 +2117,20 @@ impl crate::Response for ProxyPOSTNamespacedServiceResponse { }; Ok((ProxyPOSTNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1922,8 +2175,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPOSTNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedServiceWithPathResponse { @@ -1947,8 +2199,20 @@ impl crate::Response for ProxyPOSTNamespacedServiceWithPathResponse { }; Ok((ProxyPOSTNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1988,8 +2252,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPUTNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedServiceResponse { @@ -2013,8 +2276,20 @@ impl crate::Response for ProxyPUTNamespacedServiceResponse { }; Ok((ProxyPUTNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2059,8 +2334,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPUTNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedServiceWithPathResponse { @@ -2084,8 +2358,20 @@ impl crate::Response for ProxyPUTNamespacedServiceWithPathResponse { }; Ok((ProxyPUTNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -2157,8 +2443,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -2172,8 +2457,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2233,8 +2530,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -2248,8 +2544,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -2312,8 +2620,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -2327,8 +2634,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2391,8 +2710,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_8::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -2406,8 +2724,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -2478,8 +2808,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -2495,8 +2824,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2562,8 +2903,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -2579,8 +2919,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/core/v1/service_account.rs b/src/v1_8/api/core/v1/service_account.rs index 1043d9275a..4ea086a386 100644 --- a/src/v1_8/api/core/v1/service_account.rs +++ b/src/v1_8/api/core/v1/service_account.rs @@ -71,8 +71,7 @@ pub struct CreateNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -86,8 +85,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -193,8 +204,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -221,8 +231,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteNamespacedServiceAccountOptional<'a> { pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { Ok((DeleteNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -408,8 +441,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_8::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -423,8 +455,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -497,8 +541,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_8::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -512,8 +555,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -576,8 +631,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -591,8 +645,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -743,8 +820,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_8::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -758,8 +834,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -830,8 +918,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -847,8 +934,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -931,8 +1029,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/daemon_set.rs b/src/v1_8/api/extensions/v1beta1/daemon_set.rs index 1814a35495..f0fe46cdbb 100644 --- a/src/v1_8/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_8/api/extensions/v1beta1/daemon_set.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/deployment.rs b/src/v1_8/api/extensions/v1beta1/deployment.rs index 643c566db3..ec3fa56b1c 100644 --- a/src/v1_8/api/extensions/v1beta1/deployment.rs +++ b/src/v1_8/api/extensions/v1beta1/deployment.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_8::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_8::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_8/api/extensions/v1beta1/deployment_rollback.rs index e4ee97320d..34563b33a4 100644 --- a/src/v1_8/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_8/api/extensions/v1beta1/deployment_rollback.rs @@ -73,8 +73,7 @@ pub struct CreateNamespacedDeploymentRollbackOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_8::api::extensions::v1beta1::DeploymentRollback), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -88,8 +87,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/ingress.rs b/src/v1_8/api/extensions/v1beta1/ingress.rs index eceeb46e79..c52336a517 100644 --- a/src/v1_8/api/extensions/v1beta1/ingress.rs +++ b/src/v1_8/api/extensions/v1beta1/ingress.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedIngressResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedIngressOptional<'a> { pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { Ok((DeleteNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_8::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_8::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1056,8 +1177,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1073,8 +1193,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/network_policy.rs b/src/v1_8/api/extensions/v1beta1/network_policy.rs index c4b2f387d9..3f83128afb 100644 --- a/src/v1_8/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_8/api/extensions/v1beta1/network_policy.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -658,8 +724,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -673,8 +738,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -737,8 +814,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -752,8 +828,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -824,8 +912,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -841,8 +928,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -908,8 +1007,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -925,8 +1023,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_8/api/extensions/v1beta1/pod_security_policy.rs index e8d3969116..aea9726d8d 100644 --- a/src/v1_8/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_8/api/extensions/v1beta1/pod_security_policy.rs @@ -60,8 +60,7 @@ pub struct CreatePodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -177,8 +188,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -205,8 +215,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -539,8 +594,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -554,8 +608,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -613,8 +679,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_8::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -628,8 +693,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -695,8 +772,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -712,8 +788,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/replica_set.rs b/src/v1_8/api/extensions/v1beta1/replica_set.rs index 2e03cf7248..31da1c4472 100644 --- a/src/v1_8/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_8/api/extensions/v1beta1/replica_set.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -652,8 +718,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -667,8 +732,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -740,8 +817,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -755,8 +831,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -816,8 +904,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -831,8 +918,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -895,8 +994,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -910,8 +1008,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -974,8 +1084,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_8::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -989,8 +1098,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1061,8 +1182,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1078,8 +1198,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1145,8 +1277,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1162,8 +1293,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/extensions/v1beta1/scale.rs b/src/v1_8/api/extensions/v1beta1/scale.rs index b6c3431038..0f601d9802 100644 --- a/src/v1_8/api/extensions/v1beta1/scale.rs +++ b/src/v1_8/api/extensions/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -538,8 +604,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -553,8 +618,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -617,8 +694,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -632,8 +708,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -696,8 +784,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_8::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -711,8 +798,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/networking/v1/network_policy.rs b/src/v1_8/api/networking/v1/network_policy.rs index 9d6a5e5f4d..9c5e08b7c5 100644 --- a/src/v1_8/api/networking/v1/network_policy.rs +++ b/src/v1_8/api/networking/v1/network_policy.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -658,8 +724,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -673,8 +738,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -737,8 +814,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_8::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -752,8 +828,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -824,8 +912,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -841,8 +928,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -908,8 +1007,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -925,8 +1023,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/policy/v1beta1/eviction.rs b/src/v1_8/api/policy/v1beta1/eviction.rs index 7f9fe4540a..d6c2a3e86d 100644 --- a/src/v1_8/api/policy/v1beta1/eviction.rs +++ b/src/v1_8/api/policy/v1beta1/eviction.rs @@ -70,8 +70,7 @@ pub struct CreateNamespacedPodEvictionOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_8::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -85,8 +84,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_8/api/policy/v1beta1/pod_disruption_budget.rs index b5c5916f9f..3d19200f9f 100644 --- a/src/v1_8/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_8/api/policy/v1beta1/pod_disruption_budget.rs @@ -67,8 +67,7 @@ pub struct CreateNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -82,8 +81,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -189,8 +200,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -217,8 +227,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -297,8 +319,7 @@ pub struct DeleteNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -325,8 +346,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { Ok((DeleteNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -404,8 +437,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -419,8 +451,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -493,8 +537,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -508,8 +551,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -572,8 +627,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -587,8 +641,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -651,8 +717,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -666,8 +731,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -739,8 +816,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -754,8 +830,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -815,8 +903,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -830,8 +917,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -894,8 +993,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -909,8 +1007,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -973,8 +1083,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_8::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -988,8 +1097,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1060,8 +1181,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1077,8 +1197,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1144,8 +1276,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1161,8 +1292,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1/cluster_role.rs b/src/v1_8/api/rbac/v1/cluster_role.rs index 5c31805cfe..92b51f2bdf 100644 --- a/src/v1_8/api/rbac/v1/cluster_role.rs +++ b/src/v1_8/api/rbac/v1/cluster_role.rs @@ -60,8 +60,7 @@ pub struct CreateClusterRoleOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -150,8 +161,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -178,8 +188,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -527,8 +582,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -542,8 +596,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ReplaceClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -616,8 +681,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -683,8 +760,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -700,8 +776,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1/cluster_role_binding.rs b/src/v1_8/api/rbac/v1/cluster_role_binding.rs index 1a447c8ba0..9f5d9666e6 100644 --- a/src/v1_8/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_8/api/rbac/v1/cluster_role_binding.rs @@ -63,8 +63,7 @@ pub struct CreateClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -153,8 +164,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -181,8 +191,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -283,8 +305,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -311,8 +332,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -385,8 +418,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -400,8 +432,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -459,8 +503,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -474,8 +517,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -530,8 +585,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -545,8 +599,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -604,8 +670,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -619,8 +684,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -686,8 +763,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -703,8 +779,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1/role.rs b/src/v1_8/api/rbac/v1/role.rs index 7f31901ffa..340e51044e 100644 --- a/src/v1_8/api/rbac/v1/role.rs +++ b/src/v1_8/api/rbac/v1/role.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -646,8 +712,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -725,8 +802,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -812,8 +900,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -829,8 +916,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -896,8 +995,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -913,8 +1011,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1/role_binding.rs b/src/v1_8/api/rbac/v1/role_binding.rs index 72497c1848..1f992eac48 100644 --- a/src/v1_8/api/rbac/v1/role_binding.rs +++ b/src/v1_8/api/rbac/v1/role_binding.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -664,8 +729,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -743,8 +819,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -815,8 +903,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -832,8 +919,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -899,8 +998,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -916,8 +1014,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1alpha1/cluster_role.rs b/src/v1_8/api/rbac/v1alpha1/cluster_role.rs index c02cdec512..8a5134147f 100644 --- a/src/v1_8/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_8/api/rbac/v1alpha1/cluster_role.rs @@ -60,8 +60,7 @@ pub struct CreateClusterRoleOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -150,8 +161,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -178,8 +188,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -527,8 +582,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -542,8 +596,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ReplaceClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -616,8 +681,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -683,8 +760,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -700,8 +776,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_8/api/rbac/v1alpha1/cluster_role_binding.rs index 1e56a4ca96..63077d7fd2 100644 --- a/src/v1_8/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_8/api/rbac/v1alpha1/cluster_role_binding.rs @@ -63,8 +63,7 @@ pub struct CreateClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -153,8 +164,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -181,8 +191,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -283,8 +305,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -311,8 +332,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -385,8 +418,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -400,8 +432,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -459,8 +503,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -474,8 +517,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -530,8 +585,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -545,8 +599,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -604,8 +670,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -619,8 +684,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -686,8 +763,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -703,8 +779,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1alpha1/role.rs b/src/v1_8/api/rbac/v1alpha1/role.rs index 6b3f1a978f..00e5c558d4 100644 --- a/src/v1_8/api/rbac/v1alpha1/role.rs +++ b/src/v1_8/api/rbac/v1alpha1/role.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -646,8 +712,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -725,8 +802,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -812,8 +900,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -829,8 +916,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -896,8 +995,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -913,8 +1011,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1alpha1/role_binding.rs b/src/v1_8/api/rbac/v1alpha1/role_binding.rs index 6c7753450b..3e720e85a9 100644 --- a/src/v1_8/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_8/api/rbac/v1alpha1/role_binding.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -664,8 +729,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -743,8 +819,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -815,8 +903,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -832,8 +919,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -899,8 +998,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -916,8 +1014,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1beta1/cluster_role.rs b/src/v1_8/api/rbac/v1beta1/cluster_role.rs index 68639259a0..26cbd54289 100644 --- a/src/v1_8/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_8/api/rbac/v1beta1/cluster_role.rs @@ -60,8 +60,7 @@ pub struct CreateClusterRoleOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -75,8 +74,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -150,8 +161,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -178,8 +188,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -280,8 +302,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -308,8 +329,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -382,8 +415,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -397,8 +429,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -456,8 +500,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -471,8 +514,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -527,8 +582,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -542,8 +596,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ReplaceClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -616,8 +681,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -683,8 +760,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -700,8 +776,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_8/api/rbac/v1beta1/cluster_role_binding.rs index ccfcb6de8b..216b4223f9 100644 --- a/src/v1_8/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_8/api/rbac/v1beta1/cluster_role_binding.rs @@ -63,8 +63,7 @@ pub struct CreateClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -153,8 +164,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -181,8 +191,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -283,8 +305,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -311,8 +332,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -385,8 +418,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -400,8 +432,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -459,8 +503,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -474,8 +517,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -530,8 +585,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -545,8 +599,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -604,8 +670,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -619,8 +684,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -686,8 +763,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -703,8 +779,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1beta1/role.rs b/src/v1_8/api/rbac/v1beta1/role.rs index 831884047b..ebb048b82a 100644 --- a/src/v1_8/api/rbac/v1beta1/role.rs +++ b/src/v1_8/api/rbac/v1beta1/role.rs @@ -65,8 +65,7 @@ pub struct CreateNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -80,8 +79,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -187,8 +198,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -215,8 +225,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -295,8 +317,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -323,8 +344,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -506,8 +549,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -570,8 +625,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -585,8 +639,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -646,8 +712,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -725,8 +802,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_8::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -812,8 +900,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -829,8 +916,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -896,8 +995,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -913,8 +1011,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/rbac/v1beta1/role_binding.rs b/src/v1_8/api/rbac/v1beta1/role_binding.rs index 9d3375d089..f568520ae3 100644 --- a/src/v1_8/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_8/api/rbac/v1beta1/role_binding.rs @@ -68,8 +68,7 @@ pub struct CreateNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -83,8 +82,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -190,8 +201,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -218,8 +228,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -494,8 +538,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -509,8 +552,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -573,8 +628,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -588,8 +642,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -664,8 +729,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_8::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -743,8 +819,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -815,8 +903,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -832,8 +919,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -899,8 +998,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -916,8 +1014,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/scheduling/v1alpha1/priority_class.rs b/src/v1_8/api/scheduling/v1alpha1/priority_class.rs index dfa1dace3c..6e436463df 100644 --- a/src/v1_8/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_8/api/scheduling/v1alpha1/priority_class.rs @@ -66,8 +66,7 @@ pub struct CreatePriorityClassOptional<'a> { #[derive(Debug)] pub enum CreatePriorityClassResponse { Ok(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -81,8 +80,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -183,8 +194,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -211,8 +221,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -286,8 +308,7 @@ pub struct DeletePriorityClassOptional<'a> { pub enum DeletePriorityClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -314,8 +335,20 @@ impl crate::Response for DeletePriorityClassResponse { Ok((DeletePriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -388,8 +421,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_8::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -403,8 +435,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -462,8 +506,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -477,8 +520,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -545,8 +600,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -560,8 +614,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -619,8 +685,7 @@ pub struct ReplacePriorityClassOptional<'a> { #[derive(Debug)] pub enum ReplacePriorityClassResponse { Ok(crate::v1_8::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -634,8 +699,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -701,8 +778,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -718,8 +794,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/settings/v1alpha1/pod_preset.rs b/src/v1_8/api/settings/v1alpha1/pod_preset.rs index 97d001af29..c704b66c6b 100644 --- a/src/v1_8/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_8/api/settings/v1alpha1/pod_preset.rs @@ -63,8 +63,7 @@ pub struct CreateNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -78,8 +77,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -185,8 +196,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -213,8 +223,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -293,8 +315,7 @@ pub struct DeleteNamespacedPodPresetOptional<'a> { pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -321,8 +342,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { Ok((DeleteNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -489,8 +533,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -504,8 +547,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -568,8 +623,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -583,8 +637,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -656,8 +722,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -671,8 +736,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -735,8 +812,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_8::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -750,8 +826,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -822,8 +910,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -839,8 +926,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -906,8 +1005,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -923,8 +1021,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/storage/v1/storage_class.rs b/src/v1_8/api/storage/v1/storage_class.rs index 712e49e887..f10c2281a4 100644 --- a/src/v1_8/api/storage/v1/storage_class.rs +++ b/src/v1_8/api/storage/v1/storage_class.rs @@ -74,8 +74,7 @@ pub struct CreateStorageClassOptional<'a> { #[derive(Debug)] pub enum CreateStorageClassResponse { Ok(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -89,8 +88,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -191,8 +202,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -219,8 +229,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -294,8 +316,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -322,8 +343,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -396,8 +429,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_8::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -411,8 +443,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -470,8 +514,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -485,8 +528,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -553,8 +608,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -568,8 +622,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -627,8 +693,7 @@ pub struct ReplaceStorageClassOptional<'a> { #[derive(Debug)] pub enum ReplaceStorageClassResponse { Ok(crate::v1_8::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -642,8 +707,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -709,8 +786,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -726,8 +802,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/api/storage/v1beta1/storage_class.rs b/src/v1_8/api/storage/v1beta1/storage_class.rs index 6867343746..53cde6cc27 100644 --- a/src/v1_8/api/storage/v1beta1/storage_class.rs +++ b/src/v1_8/api/storage/v1beta1/storage_class.rs @@ -74,8 +74,7 @@ pub struct CreateStorageClassOptional<'a> { #[derive(Debug)] pub enum CreateStorageClassResponse { Ok(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -89,8 +88,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -191,8 +202,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -219,8 +229,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -294,8 +316,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -322,8 +343,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -396,8 +429,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_8::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -411,8 +443,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -470,8 +514,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -485,8 +528,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -553,8 +608,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -568,8 +622,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -627,8 +693,7 @@ pub struct ReplaceStorageClassOptional<'a> { #[derive(Debug)] pub enum ReplaceStorageClassResponse { Ok(crate::v1_8::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -642,8 +707,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -709,8 +786,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -726,8 +802,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_8/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index 7d5f94f5f0..26cc52320c 100644 --- a/src/v1_8/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_8/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -62,8 +62,7 @@ pub struct CreateCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -179,8 +190,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -207,8 +217,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -282,8 +304,7 @@ pub struct DeleteCustomResourceDefinitionOptional<'a> { pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -310,8 +331,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { Ok((DeleteCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -384,8 +417,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -399,8 +431,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -458,8 +502,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -473,8 +516,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -541,8 +596,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -556,8 +610,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -615,8 +681,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -630,8 +695,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -689,8 +766,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_8::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -704,8 +780,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -771,8 +859,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -788,8 +875,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_8/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index 3bec151461..37397b7409 100644 --- a/src/v1_8/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_8/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -62,8 +62,7 @@ pub struct CreateAPIServiceOptional<'a> { #[derive(Debug)] pub enum CreateAPIServiceResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -77,8 +76,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -180,8 +190,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -282,8 +304,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_8::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -310,8 +331,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -384,8 +417,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -399,8 +431,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -458,8 +502,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -473,8 +516,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -541,8 +596,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -556,8 +610,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -615,8 +681,7 @@ pub struct ReplaceAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReplaceAPIServiceResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -630,8 +695,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -689,8 +766,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_8::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -704,8 +780,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -771,8 +859,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -788,8 +875,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_8/mod.rs b/src/v1_8/mod.rs index c2df79f274..10302d92f8 100644 --- a/src/v1_8/mod.rs +++ b/src/v1_8/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_8::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_8::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1932,15 +2427,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -1963,15 +2469,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/admissionregistration/v1alpha1/initializer_configuration.rs b/src/v1_9/api/admissionregistration/v1alpha1/initializer_configuration.rs index 66d21daf4d..d7665bff21 100644 --- a/src/v1_9/api/admissionregistration/v1alpha1/initializer_configuration.rs +++ b/src/v1_9/api/admissionregistration/v1alpha1/initializer_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateInitializerConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), Accepted(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateInitializerConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateInitializerConfigurationResponse { }; Ok((CreateInitializerConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionInitializerConfigurationOptional<'a> { pub enum DeleteCollectionInitializerConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionInitializerConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionInitializerConfigurationResponse { Ok((DeleteCollectionInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteInitializerConfigurationOptional<'a> { pub enum DeleteInitializerConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteInitializerConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteInitializerConfigurationResponse { Ok((DeleteInitializerConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum ListInitializerConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListInitializerConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListInitializerConfigurationResponse { }; Ok((ListInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchInitializerConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchInitializerConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchInitializerConfigurationResponse { }; Ok((PatchInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadInitializerConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadInitializerConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadInitializerConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadInitializerConfigurationResponse { }; Ok((ReadInitializerConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceInitializerConfigurationOptional<'a> { pub enum ReplaceInitializerConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), Created(crate::v1_9::api::admissionregistration::v1alpha1::InitializerConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceInitializerConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceInitializerConfigurationResponse { }; Ok((ReplaceInitializerConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceInitializerConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl InitializerConfiguration { #[derive(Debug)] pub enum WatchInitializerConfigurationResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchInitializerConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchInitializerConfigurationResponse { }; Ok((WatchInitializerConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchInitializerConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchInitializerConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchInitializerConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs b/src/v1_9/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs index 7e0b9a1a3f..6b17e2a6a7 100644 --- a/src/v1_9/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs +++ b/src/v1_9/api/admissionregistration/v1beta1/mutating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateMutatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Accepted(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateMutatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateMutatingWebhookConfigurationResponse { }; Ok((CreateMutatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionMutatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionMutatingWebhookConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionMutatingWebhookConfigurationResponse { Ok((DeleteCollectionMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteMutatingWebhookConfigurationOptional<'a> { pub enum DeleteMutatingWebhookConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteMutatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteMutatingWebhookConfigurationResponse { Ok((DeleteMutatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum ListMutatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListMutatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListMutatingWebhookConfigurationResponse { }; Ok((ListMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchMutatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchMutatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchMutatingWebhookConfigurationResponse { }; Ok((PatchMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadMutatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadMutatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadMutatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadMutatingWebhookConfigurationResponse { }; Ok((ReadMutatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceMutatingWebhookConfigurationOptional<'a> { pub enum ReplaceMutatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), Created(crate::v1_9::api::admissionregistration::v1beta1::MutatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceMutatingWebhookConfigurationResponse { }; Ok((ReplaceMutatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl MutatingWebhookConfiguration { #[derive(Debug)] pub enum WatchMutatingWebhookConfigurationResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchMutatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchMutatingWebhookConfigurationResponse { }; Ok((WatchMutatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchMutatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchMutatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchMutatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/admissionregistration/v1beta1/validating_webhook_configuration.rs b/src/v1_9/api/admissionregistration/v1beta1/validating_webhook_configuration.rs index 6025624462..6442aad7e6 100644 --- a/src/v1_9/api/admissionregistration/v1beta1/validating_webhook_configuration.rs +++ b/src/v1_9/api/admissionregistration/v1beta1/validating_webhook_configuration.rs @@ -62,8 +62,7 @@ pub enum CreateValidatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Accepted(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateValidatingWebhookConfigurationResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreateValidatingWebhookConfigurationResponse { }; Ok((CreateValidatingWebhookConfigurationResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((CreateValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionValidatingWebhookConfigurationOptional<'a> { pub enum DeleteCollectionValidatingWebhookConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionValidatingWebhookConfigurationResponse Ok((DeleteCollectionValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeleteValidatingWebhookConfigurationOptional<'a> { pub enum DeleteValidatingWebhookConfigurationResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteValidatingWebhookConfigurationResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeleteValidatingWebhookConfigurationResponse { Ok((DeleteValidatingWebhookConfigurationResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((DeleteValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum ListValidatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfigurationList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListValidatingWebhookConfigurationResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListValidatingWebhookConfigurationResponse { }; Ok((ListValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ListValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum PatchValidatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchValidatingWebhookConfigurationResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchValidatingWebhookConfigurationResponse { }; Ok((PatchValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((PatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadValidatingWebhookConfigurationOptional<'a> { #[derive(Debug)] pub enum ReadValidatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadValidatingWebhookConfigurationResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadValidatingWebhookConfigurationResponse { }; Ok((ReadValidatingWebhookConfigurationResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReadValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplaceValidatingWebhookConfigurationOptional<'a> { pub enum ReplaceValidatingWebhookConfigurationResponse { Ok(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), Created(crate::v1_9::api::admissionregistration::v1beta1::ValidatingWebhookConfiguration), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplaceValidatingWebhookConfigurationResponse { }; Ok((ReplaceValidatingWebhookConfigurationResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((ReplaceValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl ValidatingWebhookConfiguration { #[derive(Debug)] pub enum WatchValidatingWebhookConfigurationResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchValidatingWebhookConfigurationResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchValidatingWebhookConfigurationResponse { }; Ok((WatchValidatingWebhookConfigurationResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchValidatingWebhookConfigurationResponse::Unauthorized, 0)), - _ => Ok((WatchValidatingWebhookConfigurationResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchValidatingWebhookConfigurationResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1/controller_revision.rs b/src/v1_9/api/apps/v1/controller_revision.rs index 51d51485ad..a655edfb1a 100644 --- a/src/v1_9/api/apps/v1/controller_revision.rs +++ b/src/v1_9/api/apps/v1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevision), Created(crate::v1_9::api::apps::v1::ControllerRevision), Accepted(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1::ControllerRevision), Created(crate::v1_9::api::apps::v1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1/daemon_set.rs b/src/v1_9/api/apps/v1/daemon_set.rs index f5065716ea..f3f339c9e9 100644 --- a/src/v1_9/api/apps/v1/daemon_set.rs +++ b/src/v1_9/api/apps/v1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), Created(crate::v1_9::api::apps::v1::DaemonSet), Accepted(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), Created(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1::DaemonSet), Created(crate::v1_9::api::apps::v1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1/deployment.rs b/src/v1_9/api/apps/v1/deployment.rs index e02b779dff..c50fab7cc6 100644 --- a/src/v1_9/api/apps/v1/deployment.rs +++ b/src/v1_9/api/apps/v1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1::Deployment), Created(crate::v1_9::api::apps::v1::Deployment), Accepted(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1::Deployment), Created(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1::Deployment), Created(crate::v1_9::api::apps::v1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1/replica_set.rs b/src/v1_9/api/apps/v1/replica_set.rs index fec889e1de..7ab4f6045b 100644 --- a/src/v1_9/api/apps/v1/replica_set.rs +++ b/src/v1_9/api/apps/v1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), Created(crate::v1_9::api::apps::v1::ReplicaSet), Accepted(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), Created(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1::ReplicaSet), Created(crate::v1_9::api::apps::v1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1/stateful_set.rs b/src/v1_9/api/apps/v1/stateful_set.rs index 1f4b3432fe..4bfadb975a 100644 --- a/src/v1_9/api/apps/v1/stateful_set.rs +++ b/src/v1_9/api/apps/v1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), Created(crate::v1_9::api::apps::v1::StatefulSet), Accepted(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), Created(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1::StatefulSet), Created(crate::v1_9::api::apps::v1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta1/controller_revision.rs b/src/v1_9/api/apps/v1beta1/controller_revision.rs index 530a231974..932cc5a19a 100644 --- a/src/v1_9/api/apps/v1beta1/controller_revision.rs +++ b/src/v1_9/api/apps/v1beta1/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevision), Created(crate::v1_9::api::apps::v1beta1::ControllerRevision), Accepted(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta1::ControllerRevision), Created(crate::v1_9::api::apps::v1beta1::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta1/deployment.rs b/src/v1_9/api/apps/v1beta1/deployment.rs index e64ca4a4e3..85b2641ad5 100644 --- a/src/v1_9/api/apps/v1beta1/deployment.rs +++ b/src/v1_9/api/apps/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), Created(crate::v1_9::api::apps::v1beta1::Deployment), Accepted(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), Created(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::Deployment), Created(crate::v1_9::api::apps::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta1/deployment_rollback.rs b/src/v1_9/api/apps/v1beta1/deployment_rollback.rs index 6ccd7c9575..c1880f193c 100644 --- a/src/v1_9/api/apps/v1beta1/deployment_rollback.rs +++ b/src/v1_9/api/apps/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), Created(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), Accepted(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta1/scale.rs b/src/v1_9/api/apps/v1beta1/scale.rs index 0e2f9724dc..6b4ff778e5 100644 --- a/src/v1_9/api/apps/v1beta1/scale.rs +++ b/src/v1_9/api/apps/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -228,8 +250,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -243,8 +264,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -304,8 +337,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -319,8 +351,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -384,8 +428,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), Created(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -407,8 +450,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -472,8 +527,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta1::Scale), Created(crate::v1_9::api::apps::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -495,8 +549,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta1/stateful_set.rs b/src/v1_9/api/apps/v1beta1/stateful_set.rs index 82de32c9a5..b0207cbc4e 100644 --- a/src/v1_9/api/apps/v1beta1/stateful_set.rs +++ b/src/v1_9/api/apps/v1beta1/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), Created(crate::v1_9::api::apps::v1beta1::StatefulSet), Accepted(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), Created(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta1::StatefulSet), Created(crate::v1_9::api::apps::v1beta1::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/controller_revision.rs b/src/v1_9/api/apps/v1beta2/controller_revision.rs index e1b31275dc..929c617725 100644 --- a/src/v1_9/api/apps/v1beta2/controller_revision.rs +++ b/src/v1_9/api/apps/v1beta2/controller_revision.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevision), Created(crate::v1_9::api::apps::v1beta2::ControllerRevision), Accepted(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedControllerRevisionResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedControllerRevisionResponse { }; Ok((CreateNamespacedControllerRevisionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedControllerRevisionOptional<'a> { pub enum DeleteCollectionNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedControllerRevisionResponse { Ok((DeleteCollectionNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedControllerRevisionOptional<'a> { pub enum DeleteNamespacedControllerRevisionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedControllerRevisionResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedControllerRevisionResponse { Ok((DeleteNamespacedControllerRevisionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListControllerRevisionForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListControllerRevisionForAllNamespacesResponse { }; Ok((ListControllerRevisionForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum ListNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevisionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedControllerRevisionResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedControllerRevisionResponse { }; Ok((ListNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedControllerRevisionResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedControllerRevisionResponse { }; Ok((PatchNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -679,8 +745,7 @@ pub struct ReadNamespacedControllerRevisionOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedControllerRevisionResponse { @@ -694,8 +759,20 @@ impl crate::Response for ReadNamespacedControllerRevisionResponse { }; Ok((ReadNamespacedControllerRevisionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -759,8 +836,7 @@ pub struct ReplaceNamespacedControllerRevisionOptional<'a> { pub enum ReplaceNamespacedControllerRevisionResponse { Ok(crate::v1_9::api::apps::v1beta2::ControllerRevision), Created(crate::v1_9::api::apps::v1beta2::ControllerRevision), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedControllerRevisionResponse { @@ -782,8 +858,20 @@ impl crate::Response for ReplaceNamespacedControllerRevisionResponse { }; Ok((ReplaceNamespacedControllerRevisionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchControllerRevisionForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchControllerRevisionForAllNamespacesResponse { }; Ok((WatchControllerRevisionForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchControllerRevisionForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchControllerRevisionForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchControllerRevisionForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -938,8 +1037,7 @@ impl ControllerRevision { #[derive(Debug)] pub enum WatchNamespacedControllerRevisionResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedControllerRevisionResponse { @@ -955,8 +1053,20 @@ impl crate::Response for WatchNamespacedControllerRevisionResponse { }; Ok((WatchNamespacedControllerRevisionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedControllerRevisionResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedControllerRevisionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedControllerRevisionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/daemon_set.rs b/src/v1_9/api/apps/v1beta2/daemon_set.rs index 73ca773cf7..216b2be41b 100644 --- a/src/v1_9/api/apps/v1beta2/daemon_set.rs +++ b/src/v1_9/api/apps/v1beta2/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), Created(crate::v1_9::api::apps::v1beta2::DaemonSet), Accepted(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), Created(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::DaemonSet), Created(crate::v1_9::api::apps::v1beta2::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/deployment.rs b/src/v1_9/api/apps/v1beta2/deployment.rs index 5e073f901f..f238a6eff0 100644 --- a/src/v1_9/api/apps/v1beta2/deployment.rs +++ b/src/v1_9/api/apps/v1beta2/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), Created(crate::v1_9::api::apps::v1beta2::Deployment), Accepted(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta2::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), Created(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::Deployment), Created(crate::v1_9::api::apps::v1beta2::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/replica_set.rs b/src/v1_9/api/apps/v1beta2/replica_set.rs index 4dc11c3e26..79bc5241c0 100644 --- a/src/v1_9/api/apps/v1beta2/replica_set.rs +++ b/src/v1_9/api/apps/v1beta2/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), Created(crate::v1_9::api::apps::v1beta2::ReplicaSet), Accepted(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), Created(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::ReplicaSet), Created(crate::v1_9::api::apps::v1beta2::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/scale.rs b/src/v1_9/api/apps/v1beta2/scale.rs index 7f51371d7e..e76bf44e52 100644 --- a/src/v1_9/api/apps/v1beta2/scale.rs +++ b/src/v1_9/api/apps/v1beta2/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), Created(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), Created(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::apps::v1beta2::Scale), Created(crate::v1_9::api::apps::v1beta2::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/apps/v1beta2/stateful_set.rs b/src/v1_9/api/apps/v1beta2/stateful_set.rs index d467532c30..3822718de1 100644 --- a/src/v1_9/api/apps/v1beta2/stateful_set.rs +++ b/src/v1_9/api/apps/v1beta2/stateful_set.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), Created(crate::v1_9::api::apps::v1beta2::StatefulSet), Accepted(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedStatefulSetResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedStatefulSetResponse { }; Ok((CreateNamespacedStatefulSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -210,8 +221,7 @@ pub struct DeleteCollectionNamespacedStatefulSetOptional<'a> { pub enum DeleteCollectionNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { @@ -238,8 +248,20 @@ impl crate::Response for DeleteCollectionNamespacedStatefulSetResponse { Ok((DeleteCollectionNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -318,8 +340,7 @@ pub struct DeleteNamespacedStatefulSetOptional<'a> { pub enum DeleteNamespacedStatefulSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedStatefulSetResponse { @@ -346,8 +367,20 @@ impl crate::Response for DeleteNamespacedStatefulSetResponse { Ok((DeleteNamespacedStatefulSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -425,8 +458,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedStatefulSetResponse { @@ -440,8 +472,20 @@ impl crate::Response for ListNamespacedStatefulSetResponse { }; Ok((ListNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -514,8 +558,7 @@ impl StatefulSet { #[derive(Debug)] pub enum ListStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStatefulSetForAllNamespacesResponse { @@ -529,8 +572,20 @@ impl crate::Response for ListStatefulSetForAllNamespacesResponse { }; Ok((ListStatefulSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -593,8 +648,7 @@ pub struct PatchNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetResponse { @@ -608,8 +662,20 @@ impl crate::Response for PatchNamespacedStatefulSetResponse { }; Ok((PatchNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -672,8 +738,7 @@ pub struct PatchNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetStatusResponse { @@ -687,8 +752,20 @@ impl crate::Response for PatchNamespacedStatefulSetStatusResponse { }; Ok((PatchNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -760,8 +837,7 @@ pub struct ReadNamespacedStatefulSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetResponse { @@ -775,8 +851,20 @@ impl crate::Response for ReadNamespacedStatefulSetResponse { }; Ok((ReadNamespacedStatefulSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -836,8 +924,7 @@ pub struct ReadNamespacedStatefulSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetStatusResponse { @@ -851,8 +938,20 @@ impl crate::Response for ReadNamespacedStatefulSetStatusResponse { }; Ok((ReadNamespacedStatefulSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -916,8 +1015,7 @@ pub struct ReplaceNamespacedStatefulSetOptional<'a> { pub enum ReplaceNamespacedStatefulSetResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), Created(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetResponse { @@ -939,8 +1037,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetResponse { }; Ok((ReplaceNamespacedStatefulSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1004,8 +1114,7 @@ pub struct ReplaceNamespacedStatefulSetStatusOptional<'a> { pub enum ReplaceNamespacedStatefulSetStatusResponse { Ok(crate::v1_9::api::apps::v1beta2::StatefulSet), Created(crate::v1_9::api::apps::v1beta2::StatefulSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { @@ -1027,8 +1136,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetStatusResponse { }; Ok((ReplaceNamespacedStatefulSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetStatusResponse::Other(result), read)) + }, } } } @@ -1099,8 +1220,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchNamespacedStatefulSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedStatefulSetResponse { @@ -1116,8 +1236,20 @@ impl crate::Response for WatchNamespacedStatefulSetResponse { }; Ok((WatchNamespacedStatefulSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedStatefulSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedStatefulSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedStatefulSetResponse::Other(result), read)) + }, } } } @@ -1183,8 +1315,7 @@ impl StatefulSet { #[derive(Debug)] pub enum WatchStatefulSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStatefulSetForAllNamespacesResponse { @@ -1200,8 +1331,20 @@ impl crate::Response for WatchStatefulSetForAllNamespacesResponse { }; Ok((WatchStatefulSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStatefulSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchStatefulSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStatefulSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authentication/v1/token_review.rs b/src/v1_9/api/authentication/v1/token_review.rs index b1eb376152..6db3d807e3 100644 --- a/src/v1_9/api/authentication/v1/token_review.rs +++ b/src/v1_9/api/authentication/v1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_9::api::authentication::v1::TokenReview), Created(crate::v1_9::api::authentication::v1::TokenReview), Accepted(crate::v1_9::api::authentication::v1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authentication/v1beta1/token_review.rs b/src/v1_9/api/authentication/v1beta1/token_review.rs index a37a461ae3..15d849defa 100644 --- a/src/v1_9/api/authentication/v1beta1/token_review.rs +++ b/src/v1_9/api/authentication/v1beta1/token_review.rs @@ -64,8 +64,7 @@ pub enum CreateTokenReviewResponse { Ok(crate::v1_9::api::authentication::v1beta1::TokenReview), Created(crate::v1_9::api::authentication::v1beta1::TokenReview), Accepted(crate::v1_9::api::authentication::v1beta1::TokenReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateTokenReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateTokenReviewResponse { }; Ok((CreateTokenReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateTokenReviewResponse::Unauthorized, 0)), - _ => Ok((CreateTokenReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateTokenReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1/local_subject_access_review.rs b/src/v1_9/api/authorization/v1/local_subject_access_review.rs index 3e8dbc83f7..93ea006e6f 100644 --- a/src/v1_9/api/authorization/v1/local_subject_access_review.rs +++ b/src/v1_9/api/authorization/v1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1::LocalSubjectAccessReview), Created(crate::v1_9::api::authorization::v1::LocalSubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1/self_subject_access_review.rs b/src/v1_9/api/authorization/v1/self_subject_access_review.rs index 6b097b35a1..2fb2e062b1 100644 --- a/src/v1_9/api/authorization/v1/self_subject_access_review.rs +++ b/src/v1_9/api/authorization/v1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1::SelfSubjectAccessReview), Created(crate::v1_9::api::authorization::v1::SelfSubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1/self_subject_rules_review.rs b/src/v1_9/api/authorization/v1/self_subject_rules_review.rs index c62330a322..c16702e8fc 100644 --- a/src/v1_9/api/authorization/v1/self_subject_rules_review.rs +++ b/src/v1_9/api/authorization/v1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_9::api::authorization::v1::SelfSubjectRulesReview), Created(crate::v1_9::api::authorization::v1::SelfSubjectRulesReview), Accepted(crate::v1_9::api::authorization::v1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1/subject_access_review.rs b/src/v1_9/api/authorization/v1/subject_access_review.rs index 6ea3ac81af..fdfc0dadec 100644 --- a/src/v1_9/api/authorization/v1/subject_access_review.rs +++ b/src/v1_9/api/authorization/v1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1::SubjectAccessReview), Created(crate::v1_9::api::authorization::v1::SubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1beta1/local_subject_access_review.rs b/src/v1_9/api/authorization/v1beta1/local_subject_access_review.rs index 77cef5fd31..d5b38e4008 100644 --- a/src/v1_9/api/authorization/v1beta1/local_subject_access_review.rs +++ b/src/v1_9/api/authorization/v1beta1/local_subject_access_review.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedLocalSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1beta1::LocalSubjectAccessReview), Created(crate::v1_9::api::authorization::v1beta1::LocalSubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1beta1::LocalSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedLocalSubjectAccessReviewResponse { }; Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLocalSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1beta1/self_subject_access_review.rs b/src/v1_9/api/authorization/v1beta1/self_subject_access_review.rs index 409533e992..1849ed784e 100644 --- a/src/v1_9/api/authorization/v1beta1/self_subject_access_review.rs +++ b/src/v1_9/api/authorization/v1beta1/self_subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1beta1::SelfSubjectAccessReview), Created(crate::v1_9::api::authorization::v1beta1::SelfSubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1beta1::SelfSubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectAccessReviewResponse { }; Ok((CreateSelfSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1beta1/self_subject_rules_review.rs b/src/v1_9/api/authorization/v1beta1/self_subject_rules_review.rs index a61dd1c019..a37b9d5da6 100644 --- a/src/v1_9/api/authorization/v1beta1/self_subject_rules_review.rs +++ b/src/v1_9/api/authorization/v1beta1/self_subject_rules_review.rs @@ -64,8 +64,7 @@ pub enum CreateSelfSubjectRulesReviewResponse { Ok(crate::v1_9::api::authorization::v1beta1::SelfSubjectRulesReview), Created(crate::v1_9::api::authorization::v1beta1::SelfSubjectRulesReview), Accepted(crate::v1_9::api::authorization::v1beta1::SelfSubjectRulesReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSelfSubjectRulesReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSelfSubjectRulesReviewResponse { }; Ok((CreateSelfSubjectRulesReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSelfSubjectRulesReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSelfSubjectRulesReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSelfSubjectRulesReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/authorization/v1beta1/subject_access_review.rs b/src/v1_9/api/authorization/v1beta1/subject_access_review.rs index e57f148765..21a6c2f761 100644 --- a/src/v1_9/api/authorization/v1beta1/subject_access_review.rs +++ b/src/v1_9/api/authorization/v1beta1/subject_access_review.rs @@ -64,8 +64,7 @@ pub enum CreateSubjectAccessReviewResponse { Ok(crate::v1_9::api::authorization::v1beta1::SubjectAccessReview), Created(crate::v1_9::api::authorization::v1beta1::SubjectAccessReview), Accepted(crate::v1_9::api::authorization::v1beta1::SubjectAccessReview), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateSubjectAccessReviewResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateSubjectAccessReviewResponse { }; Ok((CreateSubjectAccessReviewResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateSubjectAccessReviewResponse::Unauthorized, 0)), - _ => Ok((CreateSubjectAccessReviewResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateSubjectAccessReviewResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/autoscaling/v1/horizontal_pod_autoscaler.rs b/src/v1_9/api/autoscaling/v1/horizontal_pod_autoscaler.rs index 8eaf667313..5408fb0de2 100644 --- a/src/v1_9/api/autoscaling/v1/horizontal_pod_autoscaler.rs +++ b/src/v1_9/api/autoscaling/v1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), Accepted(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/autoscaling/v1/scale.rs b/src/v1_9/api/autoscaling/v1/scale.rs index 31438f2f96..4d17e44ede 100644 --- a/src/v1_9/api/autoscaling/v1/scale.rs +++ b/src/v1_9/api/autoscaling/v1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedStatefulSetScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedStatefulSetScaleResponse { }; Ok((PatchNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -310,8 +343,7 @@ pub struct PatchNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { @@ -325,8 +357,20 @@ impl crate::Response for PatchNamespacedReplicationControllerScaleResponse { }; Ok((PatchNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -386,8 +430,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -401,8 +444,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -462,8 +517,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -477,8 +531,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -538,8 +604,7 @@ pub struct ReadNamespacedStatefulSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedStatefulSetScaleResponse { @@ -553,8 +618,20 @@ impl crate::Response for ReadNamespacedStatefulSetScaleResponse { }; Ok((ReadNamespacedStatefulSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -614,8 +691,7 @@ pub struct ReadNamespacedReplicationControllerScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { @@ -629,8 +705,20 @@ impl crate::Response for ReadNamespacedReplicationControllerScaleResponse { }; Ok((ReadNamespacedReplicationControllerScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } @@ -694,8 +782,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), Created(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -717,8 +804,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -782,8 +881,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), Created(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -805,8 +903,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -870,8 +980,7 @@ pub struct ReplaceNamespacedStatefulSetScaleOptional<'a> { pub enum ReplaceNamespacedStatefulSetScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), Created(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { @@ -893,8 +1002,20 @@ impl crate::Response for ReplaceNamespacedStatefulSetScaleResponse { }; Ok((ReplaceNamespacedStatefulSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedStatefulSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedStatefulSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedStatefulSetScaleResponse::Other(result), read)) + }, } } } @@ -958,8 +1079,7 @@ pub struct ReplaceNamespacedReplicationControllerScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerScaleResponse { Ok(crate::v1_9::api::autoscaling::v1::Scale), Created(crate::v1_9::api::autoscaling::v1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { @@ -981,8 +1101,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerScaleResponse { }; Ok((ReplaceNamespacedReplicationControllerScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs b/src/v1_9/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs index e821a40181..f2294507c4 100644 --- a/src/v1_9/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs +++ b/src/v1_9/api/autoscaling/v2beta1/horizontal_pod_autoscaler.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Accepted(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedHorizontalPodAutoscalerResponse { }; Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedHorizontalPodAutoscalerRespon Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum DeleteNamespacedHorizontalPodAutoscalerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedHorizontalPodAutoscalerResponse { Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum ListNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscalerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedHorizontalPodAutoscalerResponse { }; Ok((ListNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedHorizontalPodAutoscalerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedHorizontalPodAutoscalerStatusResponse { }; Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerResponse { }; Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedHorizontalPodAutoscalerStatusOptional<'a> { pub enum ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { Ok(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), Created(crate::v1_9::api::autoscaling::v2beta1::HorizontalPodAutoscaler), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedHorizontalPodAutoscalerStatusResponse }; Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedHorizontalPodAutoscalerStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchHorizontalPodAutoscalerForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchHorizontalPodAutoscalerForAllNamespacesResponse { }; Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchHorizontalPodAutoscalerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl HorizontalPodAutoscaler { #[derive(Debug)] pub enum WatchNamespacedHorizontalPodAutoscalerResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedHorizontalPodAutoscalerResponse { }; Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedHorizontalPodAutoscalerResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/batch/v1/job.rs b/src/v1_9/api/batch/v1/job.rs index 4a884241ef..bac8a9b73e 100644 --- a/src/v1_9/api/batch/v1/job.rs +++ b/src/v1_9/api/batch/v1/job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedJobResponse { Ok(crate::v1_9::api::batch::v1::Job), Created(crate::v1_9::api::batch::v1::Job), Accepted(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedJobResponse { }; Ok((CreateNamespacedJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedJobOptional<'a> { pub enum DeleteCollectionNamespacedJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedJobResponse { Ok((DeleteCollectionNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedJobOptional<'a> { pub enum DeleteNamespacedJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedJobResponse { Ok((DeleteNamespacedJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Job { #[derive(Debug)] pub enum ListJobForAllNamespacesResponse { Ok(crate::v1_9::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListJobForAllNamespacesResponse { }; Ok((ListJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Job { #[derive(Debug)] pub enum ListNamespacedJobResponse { Ok(crate::v1_9::api::batch::v1::JobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedJobResponse { }; Ok((ListNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobResponse { Ok(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedJobResponse { }; Ok((PatchNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedJobStatusResponse { Ok(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedJobStatusResponse { }; Ok((PatchNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobResponse { Ok(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedJobResponse { }; Ok((ReadNamespacedJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedJobStatusResponse { Ok(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedJobStatusResponse { }; Ok((ReadNamespacedJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedJobOptional<'a> { pub enum ReplaceNamespacedJobResponse { Ok(crate::v1_9::api::batch::v1::Job), Created(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedJobResponse { }; Ok((ReplaceNamespacedJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedJobStatusOptional<'a> { pub enum ReplaceNamespacedJobStatusResponse { Ok(crate::v1_9::api::batch::v1::Job), Created(crate::v1_9::api::batch::v1::Job), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedJobStatusResponse { }; Ok((ReplaceNamespacedJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Job { #[derive(Debug)] pub enum WatchJobForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchJobForAllNamespacesResponse { }; Ok((WatchJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Job { #[derive(Debug)] pub enum WatchNamespacedJobResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedJobResponse { }; Ok((WatchNamespacedJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/batch/v1beta1/cron_job.rs b/src/v1_9/api/batch/v1beta1/cron_job.rs index 5ed86d85ee..7294ec0c9b 100644 --- a/src/v1_9/api/batch/v1beta1/cron_job.rs +++ b/src/v1_9/api/batch/v1beta1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), Created(crate::v1_9::api::batch::v1beta1::CronJob), Accepted(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), Created(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v1beta1::CronJob), Created(crate::v1_9::api::batch::v1beta1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/batch/v2alpha1/cron_job.rs b/src/v1_9/api/batch/v2alpha1/cron_job.rs index 1cf00bf90f..fc9e4150e4 100644 --- a/src/v1_9/api/batch/v2alpha1/cron_job.rs +++ b/src/v1_9/api/batch/v2alpha1/cron_job.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), Created(crate::v1_9::api::batch::v2alpha1::CronJob), Accepted(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedCronJobResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedCronJobResponse { }; Ok((CreateNamespacedCronJobResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedCronJobOptional<'a> { pub enum DeleteCollectionNamespacedCronJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedCronJobResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedCronJobResponse { Ok((DeleteCollectionNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedCronJobOptional<'a> { pub enum DeleteNamespacedCronJobResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedCronJobResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedCronJobResponse { Ok((DeleteNamespacedCronJobResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl CronJob { #[derive(Debug)] pub enum ListCronJobForAllNamespacesResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCronJobForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListCronJobForAllNamespacesResponse { }; Ok((ListCronJobForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl CronJob { #[derive(Debug)] pub enum ListNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJobList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedCronJobResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedCronJobResponse { }; Ok((ListNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedCronJobResponse { }; Ok((PatchNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedCronJobStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedCronJobStatusResponse { }; Ok((PatchNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedCronJobOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedCronJobResponse { }; Ok((ReadNamespacedCronJobResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedCronJobStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedCronJobStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedCronJobStatusResponse { }; Ok((ReadNamespacedCronJobStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedCronJobOptional<'a> { pub enum ReplaceNamespacedCronJobResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), Created(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedCronJobResponse { }; Ok((ReplaceNamespacedCronJobResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedCronJobStatusOptional<'a> { pub enum ReplaceNamespacedCronJobStatusResponse { Ok(crate::v1_9::api::batch::v2alpha1::CronJob), Created(crate::v1_9::api::batch::v2alpha1::CronJob), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedCronJobStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedCronJobStatusResponse { }; Ok((ReplaceNamespacedCronJobStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedCronJobStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedCronJobStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedCronJobStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchCronJobForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCronJobForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchCronJobForAllNamespacesResponse { }; Ok((WatchCronJobForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCronJobForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchCronJobForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCronJobForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl CronJob { #[derive(Debug)] pub enum WatchNamespacedCronJobResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedCronJobResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedCronJobResponse { }; Ok((WatchNamespacedCronJobResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedCronJobResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedCronJobResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedCronJobResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/certificates/v1beta1/certificate_signing_request.rs b/src/v1_9/api/certificates/v1beta1/certificate_signing_request.rs index b090d9505a..d0bbecad7b 100644 --- a/src/v1_9/api/certificates/v1beta1/certificate_signing_request.rs +++ b/src/v1_9/api/certificates/v1beta1/certificate_signing_request.rs @@ -64,8 +64,7 @@ pub enum CreateCertificateSigningRequestResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), Accepted(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCertificateSigningRequestResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCertificateSigningRequestResponse { }; Ok((CreateCertificateSigningRequestResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((CreateCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteCertificateSigningRequestOptional<'a> { pub enum DeleteCertificateSigningRequestResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCertificateSigningRequestResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteCertificateSigningRequestResponse { Ok((DeleteCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionCertificateSigningRequestOptional<'a> { pub enum DeleteCollectionCertificateSigningRequestResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionCertificateSigningRequestResponse { Ok((DeleteCollectionCertificateSigningRequestResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum ListCertificateSigningRequestResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequestList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCertificateSigningRequestResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCertificateSigningRequestResponse { }; Ok((ListCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ListCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum PatchCertificateSigningRequestResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCertificateSigningRequestResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCertificateSigningRequestResponse { }; Ok((PatchCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((PatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadCertificateSigningRequestOptional<'a> { #[derive(Debug)] pub enum ReadCertificateSigningRequestResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCertificateSigningRequestResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadCertificateSigningRequestResponse { }; Ok((ReadCertificateSigningRequestResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReadCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceCertificateSigningRequestOptional<'a> { pub enum ReplaceCertificateSigningRequestResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceCertificateSigningRequestResponse { }; Ok((ReplaceCertificateSigningRequestResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceCertificateSigningRequestApprovalOptional<'a> { pub enum ReplaceCertificateSigningRequestApprovalResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceCertificateSigningRequestApprovalResponse { }; Ok((ReplaceCertificateSigningRequestApprovalResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestApprovalResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestApprovalResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestApprovalResponse::Other(result), read)) + }, } } } @@ -800,8 +888,7 @@ pub struct ReplaceCertificateSigningRequestStatusOptional<'a> { pub enum ReplaceCertificateSigningRequestStatusResponse { Ok(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), Created(crate::v1_9::api::certificates::v1beta1::CertificateSigningRequest), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { @@ -823,8 +910,20 @@ impl crate::Response for ReplaceCertificateSigningRequestStatusResponse { }; Ok((ReplaceCertificateSigningRequestStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCertificateSigningRequestStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCertificateSigningRequestStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCertificateSigningRequestStatusResponse::Other(result), read)) + }, } } } @@ -890,8 +989,7 @@ impl CertificateSigningRequest { #[derive(Debug)] pub enum WatchCertificateSigningRequestResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCertificateSigningRequestResponse { @@ -907,8 +1005,20 @@ impl crate::Response for WatchCertificateSigningRequestResponse { }; Ok((WatchCertificateSigningRequestResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCertificateSigningRequestResponse::Unauthorized, 0)), - _ => Ok((WatchCertificateSigningRequestResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCertificateSigningRequestResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/binding.rs b/src/v1_9/api/core/v1/binding.rs index bc25ecc25a..0291aef47a 100644 --- a/src/v1_9/api/core/v1/binding.rs +++ b/src/v1_9/api/core/v1/binding.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedBindingResponse { Ok(crate::v1_9::api::core::v1::Binding), Created(crate::v1_9::api::core::v1::Binding), Accepted(crate::v1_9::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedBindingResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedBindingResponse { }; Ok((CreateNamespacedBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedBindingResponse::Other(result), read)) + }, } } } @@ -164,8 +175,7 @@ pub enum CreateNamespacedPodBindingResponse { Ok(crate::v1_9::api::core::v1::Binding), Created(crate::v1_9::api::core::v1::Binding), Accepted(crate::v1_9::api::core::v1::Binding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodBindingResponse { @@ -195,8 +205,20 @@ impl crate::Response for CreateNamespacedPodBindingResponse { }; Ok((CreateNamespacedPodBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/component_status.rs b/src/v1_9/api/core/v1/component_status.rs index c12b25a98c..ca19bf43a8 100644 --- a/src/v1_9/api/core/v1/component_status.rs +++ b/src/v1_9/api/core/v1/component_status.rs @@ -80,8 +80,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum ListComponentStatusResponse { Ok(crate::v1_9::api::core::v1::ComponentStatusList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListComponentStatusResponse { @@ -95,8 +94,20 @@ impl crate::Response for ListComponentStatusResponse { }; Ok((ListComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ListComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListComponentStatusResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ReadComponentStatusOptional<'a> { #[derive(Debug)] pub enum ReadComponentStatusResponse { Ok(crate::v1_9::api::core::v1::ComponentStatus), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadComponentStatusResponse { @@ -166,8 +176,20 @@ impl crate::Response for ReadComponentStatusResponse { }; Ok((ReadComponentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadComponentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadComponentStatusResponse::Other(result), read)) + }, } } } @@ -233,8 +255,7 @@ impl ComponentStatus { #[derive(Debug)] pub enum WatchComponentStatusResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchComponentStatusResponse { @@ -250,8 +271,20 @@ impl crate::Response for WatchComponentStatusResponse { }; Ok((WatchComponentStatusResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchComponentStatusResponse::Unauthorized, 0)), - _ => Ok((WatchComponentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchComponentStatusResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/config_map.rs b/src/v1_9/api/core/v1/config_map.rs index f350fde518..2dfa636bd9 100644 --- a/src/v1_9/api/core/v1/config_map.rs +++ b/src/v1_9/api/core/v1/config_map.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedConfigMapResponse { Ok(crate::v1_9::api::core::v1::ConfigMap), Created(crate::v1_9::api::core::v1::ConfigMap), Accepted(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedConfigMapResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedConfigMapResponse { }; Ok((CreateNamespacedConfigMapResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedConfigMapOptional<'a> { pub enum DeleteCollectionNamespacedConfigMapResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedConfigMapResponse { Ok((DeleteCollectionNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedConfigMapOptional<'a> { pub enum DeleteNamespacedConfigMapResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedConfigMapResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedConfigMapResponse { Ok((DeleteNamespacedConfigMapResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -415,8 +448,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListConfigMapForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListConfigMapForAllNamespacesResponse { @@ -430,8 +462,20 @@ impl crate::Response for ListConfigMapForAllNamespacesResponse { }; Ok((ListConfigMapForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl ConfigMap { #[derive(Debug)] pub enum ListNamespacedConfigMapResponse { Ok(crate::v1_9::api::core::v1::ConfigMapList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedConfigMapResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNamespacedConfigMapResponse { }; Ok((ListNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedConfigMapResponse { Ok(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedConfigMapResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedConfigMapResponse { }; Ok((PatchNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedConfigMapOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedConfigMapResponse { Ok(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedConfigMapResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedConfigMapResponse { }; Ok((ReadNamespacedConfigMapResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedConfigMapOptional<'a> { pub enum ReplaceNamespacedConfigMapResponse { Ok(crate::v1_9::api::core::v1::ConfigMap), Created(crate::v1_9::api::core::v1::ConfigMap), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedConfigMapResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedConfigMapResponse { }; Ok((ReplaceNamespacedConfigMapResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedConfigMapResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchConfigMapForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchConfigMapForAllNamespacesResponse { @@ -863,8 +950,20 @@ impl crate::Response for WatchConfigMapForAllNamespacesResponse { }; Ok((WatchConfigMapForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchConfigMapForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchConfigMapForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchConfigMapForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl ConfigMap { #[derive(Debug)] pub enum WatchNamespacedConfigMapResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedConfigMapResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNamespacedConfigMapResponse { }; Ok((WatchNamespacedConfigMapResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedConfigMapResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedConfigMapResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedConfigMapResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/endpoints.rs b/src/v1_9/api/core/v1/endpoints.rs index 786266ca7a..7b4e44b005 100644 --- a/src/v1_9/api/core/v1/endpoints.rs +++ b/src/v1_9/api/core/v1/endpoints.rs @@ -78,8 +78,7 @@ pub enum CreateNamespacedEndpointsResponse { Ok(crate::v1_9::api::core::v1::Endpoints), Created(crate::v1_9::api::core::v1::Endpoints), Accepted(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEndpointsResponse { @@ -109,8 +108,20 @@ impl crate::Response for CreateNamespacedEndpointsResponse { }; Ok((CreateNamespacedEndpointsResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -216,8 +227,7 @@ pub struct DeleteCollectionNamespacedEndpointsOptional<'a> { pub enum DeleteCollectionNamespacedEndpointsResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { @@ -244,8 +254,20 @@ impl crate::Response for DeleteCollectionNamespacedEndpointsResponse { Ok((DeleteCollectionNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -324,8 +346,7 @@ pub struct DeleteNamespacedEndpointsOptional<'a> { pub enum DeleteNamespacedEndpointsResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEndpointsResponse { @@ -352,8 +373,20 @@ impl crate::Response for DeleteNamespacedEndpointsResponse { Ok((DeleteNamespacedEndpointsResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListEndpointsForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEndpointsForAllNamespacesResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListEndpointsForAllNamespacesResponse { }; Ok((ListEndpointsForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -520,8 +564,7 @@ impl Endpoints { #[derive(Debug)] pub enum ListNamespacedEndpointsResponse { Ok(crate::v1_9::api::core::v1::EndpointsList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEndpointsResponse { @@ -535,8 +578,20 @@ impl crate::Response for ListNamespacedEndpointsResponse { }; Ok((ListNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -599,8 +654,7 @@ pub struct PatchNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEndpointsResponse { Ok(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEndpointsResponse { @@ -614,8 +668,20 @@ impl crate::Response for PatchNamespacedEndpointsResponse { }; Ok((PatchNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -687,8 +753,7 @@ pub struct ReadNamespacedEndpointsOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEndpointsResponse { Ok(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEndpointsResponse { @@ -702,8 +767,20 @@ impl crate::Response for ReadNamespacedEndpointsResponse { }; Ok((ReadNamespacedEndpointsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -767,8 +844,7 @@ pub struct ReplaceNamespacedEndpointsOptional<'a> { pub enum ReplaceNamespacedEndpointsResponse { Ok(crate::v1_9::api::core::v1::Endpoints), Created(crate::v1_9::api::core::v1::Endpoints), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEndpointsResponse { @@ -790,8 +866,20 @@ impl crate::Response for ReplaceNamespacedEndpointsResponse { }; Ok((ReplaceNamespacedEndpointsResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEndpointsResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchEndpointsForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEndpointsForAllNamespacesResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchEndpointsForAllNamespacesResponse { }; Ok((WatchEndpointsForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEndpointsForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEndpointsForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEndpointsForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -946,8 +1045,7 @@ impl Endpoints { #[derive(Debug)] pub enum WatchNamespacedEndpointsResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEndpointsResponse { @@ -963,8 +1061,20 @@ impl crate::Response for WatchNamespacedEndpointsResponse { }; Ok((WatchNamespacedEndpointsResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEndpointsResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEndpointsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEndpointsResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/event.rs b/src/v1_9/api/core/v1/event.rs index ccdeca1ca3..3b6d0cce5f 100644 --- a/src/v1_9/api/core/v1/event.rs +++ b/src/v1_9/api/core/v1/event.rs @@ -106,8 +106,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_9::api::core::v1::Event), Created(crate::v1_9::api::core::v1::Event), Accepted(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -137,8 +136,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -244,8 +255,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -272,8 +282,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -352,8 +374,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -380,8 +401,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -454,8 +487,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -469,8 +501,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -548,8 +592,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_9::api::core::v1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -563,8 +606,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -627,8 +682,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -642,8 +696,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -715,8 +781,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -730,8 +795,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -795,8 +872,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_9::api::core::v1::Event), Created(crate::v1_9::api::core::v1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -818,8 +894,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -885,8 +973,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -902,8 +989,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -974,8 +1073,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -991,8 +1089,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/limit_range.rs b/src/v1_9/api/core/v1/limit_range.rs index e5b2142279..d3ddbe6707 100644 --- a/src/v1_9/api/core/v1/limit_range.rs +++ b/src/v1_9/api/core/v1/limit_range.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedLimitRangeResponse { Ok(crate::v1_9::api::core::v1::LimitRange), Created(crate::v1_9::api::core::v1::LimitRange), Accepted(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedLimitRangeResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedLimitRangeResponse { }; Ok((CreateNamespacedLimitRangeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedLimitRangeOptional<'a> { pub enum DeleteCollectionNamespacedLimitRangeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedLimitRangeResponse { Ok((DeleteCollectionNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedLimitRangeOptional<'a> { pub enum DeleteNamespacedLimitRangeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedLimitRangeResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedLimitRangeResponse { Ok((DeleteNamespacedLimitRangeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -415,8 +448,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListLimitRangeForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListLimitRangeForAllNamespacesResponse { @@ -430,8 +462,20 @@ impl crate::Response for ListLimitRangeForAllNamespacesResponse { }; Ok((ListLimitRangeForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl LimitRange { #[derive(Debug)] pub enum ListNamespacedLimitRangeResponse { Ok(crate::v1_9::api::core::v1::LimitRangeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedLimitRangeResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNamespacedLimitRangeResponse { }; Ok((ListNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedLimitRangeResponse { Ok(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedLimitRangeResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedLimitRangeResponse { }; Ok((PatchNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedLimitRangeOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedLimitRangeResponse { Ok(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedLimitRangeResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedLimitRangeResponse { }; Ok((ReadNamespacedLimitRangeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedLimitRangeOptional<'a> { pub enum ReplaceNamespacedLimitRangeResponse { Ok(crate::v1_9::api::core::v1::LimitRange), Created(crate::v1_9::api::core::v1::LimitRange), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedLimitRangeResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedLimitRangeResponse { }; Ok((ReplaceNamespacedLimitRangeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedLimitRangeResponse::Other(result), read)) + }, } } } @@ -846,8 +934,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchLimitRangeForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchLimitRangeForAllNamespacesResponse { @@ -863,8 +950,20 @@ impl crate::Response for WatchLimitRangeForAllNamespacesResponse { }; Ok((WatchLimitRangeForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchLimitRangeForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchLimitRangeForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchLimitRangeForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl LimitRange { #[derive(Debug)] pub enum WatchNamespacedLimitRangeResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedLimitRangeResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNamespacedLimitRangeResponse { }; Ok((WatchNamespacedLimitRangeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedLimitRangeResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedLimitRangeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedLimitRangeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/namespace.rs b/src/v1_9/api/core/v1/namespace.rs index c76f7dae9a..373a46ecaa 100644 --- a/src/v1_9/api/core/v1/namespace.rs +++ b/src/v1_9/api/core/v1/namespace.rs @@ -65,8 +65,7 @@ pub enum CreateNamespaceResponse { Ok(crate::v1_9::api::core::v1::Namespace), Created(crate::v1_9::api::core::v1::Namespace), Accepted(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespaceResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespaceResponse { }; Ok((CreateNamespaceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespaceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespaceResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteNamespaceOptional<'a> { pub enum DeleteNamespaceResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespaceResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteNamespaceResponse { Ok((DeleteNamespaceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespaceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespaceResponse::Other(result), read)) + }, } } } @@ -273,8 +295,7 @@ impl Namespace { #[derive(Debug)] pub enum ListNamespaceResponse { Ok(crate::v1_9::api::core::v1::NamespaceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespaceResponse { @@ -288,8 +309,20 @@ impl crate::Response for ListNamespaceResponse { }; Ok((ListNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespaceResponse::Unauthorized, 0)), - _ => Ok((ListNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespaceResponse::Other(result), read)) + }, } } } @@ -347,8 +380,7 @@ pub struct PatchNamespaceOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceResponse { Ok(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceResponse { @@ -362,8 +394,20 @@ impl crate::Response for PatchNamespaceResponse { }; Ok((PatchNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceResponse::Other(result), read)) + }, } } } @@ -421,8 +465,7 @@ pub struct PatchNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespaceStatusResponse { Ok(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespaceStatusResponse { @@ -436,8 +479,20 @@ impl crate::Response for PatchNamespaceStatusResponse { }; Ok((PatchNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -504,8 +559,7 @@ pub struct ReadNamespaceOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceResponse { Ok(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceResponse { @@ -519,8 +573,20 @@ impl crate::Response for ReadNamespaceResponse { }; Ok((ReadNamespaceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceResponse::Other(result), read)) + }, } } } @@ -575,8 +641,7 @@ pub struct ReadNamespaceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespaceStatusResponse { Ok(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespaceStatusResponse { @@ -590,8 +655,20 @@ impl crate::Response for ReadNamespaceStatusResponse { }; Ok((ReadNamespaceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -650,8 +727,7 @@ pub struct ReplaceNamespaceOptional<'a> { pub enum ReplaceNamespaceResponse { Ok(crate::v1_9::api::core::v1::Namespace), Created(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceResponse { @@ -673,8 +749,20 @@ impl crate::Response for ReplaceNamespaceResponse { }; Ok((ReplaceNamespaceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ReplaceNamespaceFinalizeOptional<'a> { pub enum ReplaceNamespaceFinalizeResponse { Ok(crate::v1_9::api::core::v1::Namespace), Created(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceFinalizeResponse { @@ -756,8 +843,20 @@ impl crate::Response for ReplaceNamespaceFinalizeResponse { }; Ok((ReplaceNamespaceFinalizeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceFinalizeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceFinalizeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceFinalizeResponse::Other(result), read)) + }, } } } @@ -816,8 +915,7 @@ pub struct ReplaceNamespaceStatusOptional<'a> { pub enum ReplaceNamespaceStatusResponse { Ok(crate::v1_9::api::core::v1::Namespace), Created(crate::v1_9::api::core::v1::Namespace), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespaceStatusResponse { @@ -839,8 +937,20 @@ impl crate::Response for ReplaceNamespaceStatusResponse { }; Ok((ReplaceNamespaceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespaceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespaceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespaceStatusResponse::Other(result), read)) + }, } } } @@ -906,8 +1016,7 @@ impl Namespace { #[derive(Debug)] pub enum WatchNamespaceResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespaceResponse { @@ -923,8 +1032,20 @@ impl crate::Response for WatchNamespaceResponse { }; Ok((WatchNamespaceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespaceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespaceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespaceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/node.rs b/src/v1_9/api/core/v1/node.rs index 6aadaba8b1..8f89469cde 100644 --- a/src/v1_9/api/core/v1/node.rs +++ b/src/v1_9/api/core/v1/node.rs @@ -65,8 +65,7 @@ pub struct ConnectDeleteNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyResponse { @@ -90,8 +89,20 @@ impl crate::Response for ConnectDeleteNodeProxyResponse { }; Ok((ConnectDeleteNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyResponse::Other(result), read)) + }, } } } @@ -151,8 +162,7 @@ pub struct ConnectDeleteNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { @@ -176,8 +186,20 @@ impl crate::Response for ConnectDeleteNodeProxyWithPathResponse { }; Ok((ConnectDeleteNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -232,8 +254,7 @@ pub struct ConnectGetNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyResponse { @@ -257,8 +278,20 @@ impl crate::Response for ConnectGetNodeProxyResponse { }; Ok((ConnectGetNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyResponse::Other(result), read)) + }, } } } @@ -318,8 +351,7 @@ pub struct ConnectGetNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNodeProxyWithPathResponse { @@ -343,8 +375,20 @@ impl crate::Response for ConnectGetNodeProxyWithPathResponse { }; Ok((ConnectGetNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -399,8 +443,7 @@ pub struct ConnectPatchNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyResponse { @@ -424,8 +467,20 @@ impl crate::Response for ConnectPatchNodeProxyResponse { }; Ok((ConnectPatchNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyResponse::Other(result), read)) + }, } } } @@ -485,8 +540,7 @@ pub struct ConnectPatchNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNodeProxyWithPathResponse { @@ -510,8 +564,20 @@ impl crate::Response for ConnectPatchNodeProxyWithPathResponse { }; Ok((ConnectPatchNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -566,8 +632,7 @@ pub struct ConnectPostNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyResponse { @@ -591,8 +656,20 @@ impl crate::Response for ConnectPostNodeProxyResponse { }; Ok((ConnectPostNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyResponse::Other(result), read)) + }, } } } @@ -652,8 +729,7 @@ pub struct ConnectPostNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNodeProxyWithPathResponse { @@ -677,8 +753,20 @@ impl crate::Response for ConnectPostNodeProxyWithPathResponse { }; Ok((ConnectPostNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -733,8 +821,7 @@ pub struct ConnectPutNodeProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyResponse { @@ -758,8 +845,20 @@ impl crate::Response for ConnectPutNodeProxyResponse { }; Ok((ConnectPutNodeProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyResponse::Other(result), read)) + }, } } } @@ -819,8 +918,7 @@ pub struct ConnectPutNodeProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNodeProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNodeProxyWithPathResponse { @@ -844,8 +942,20 @@ impl crate::Response for ConnectPutNodeProxyWithPathResponse { }; Ok((ConnectPutNodeProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNodeProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNodeProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNodeProxyWithPathResponse::Other(result), read)) + }, } } } @@ -900,8 +1010,7 @@ pub enum CreateNodeResponse { Ok(crate::v1_9::api::core::v1::Node), Created(crate::v1_9::api::core::v1::Node), Accepted(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNodeResponse { @@ -931,8 +1040,20 @@ impl crate::Response for CreateNodeResponse { }; Ok((CreateNodeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNodeResponse::Unauthorized, 0)), - _ => Ok((CreateNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNodeResponse::Other(result), read)) + }, } } } @@ -1033,8 +1154,7 @@ pub struct DeleteCollectionNodeOptional<'a> { pub enum DeleteCollectionNodeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNodeResponse { @@ -1061,8 +1181,20 @@ impl crate::Response for DeleteCollectionNodeResponse { Ok((DeleteCollectionNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNodeResponse::Other(result), read)) + }, } } } @@ -1136,8 +1268,7 @@ pub struct DeleteNodeOptional<'a> { pub enum DeleteNodeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNodeResponse { @@ -1164,8 +1295,20 @@ impl crate::Response for DeleteNodeResponse { Ok((DeleteNodeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNodeResponse::Unauthorized, 0)), - _ => Ok((DeleteNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNodeResponse::Other(result), read)) + }, } } } @@ -1238,8 +1381,7 @@ impl Node { #[derive(Debug)] pub enum ListNodeResponse { Ok(crate::v1_9::api::core::v1::NodeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNodeResponse { @@ -1253,8 +1395,20 @@ impl crate::Response for ListNodeResponse { }; Ok((ListNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNodeResponse::Unauthorized, 0)), - _ => Ok((ListNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNodeResponse::Other(result), read)) + }, } } } @@ -1312,8 +1466,7 @@ pub struct PatchNodeOptional<'a> { #[derive(Debug)] pub enum PatchNodeResponse { Ok(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeResponse { @@ -1327,8 +1480,20 @@ impl crate::Response for PatchNodeResponse { }; Ok((PatchNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeResponse::Unauthorized, 0)), - _ => Ok((PatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeResponse::Other(result), read)) + }, } } } @@ -1386,8 +1551,7 @@ pub struct PatchNodeStatusOptional<'a> { #[derive(Debug)] pub enum PatchNodeStatusResponse { Ok(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNodeStatusResponse { @@ -1401,8 +1565,20 @@ impl crate::Response for PatchNodeStatusResponse { }; Ok((PatchNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNodeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNodeStatusResponse::Other(result), read)) + }, } } } @@ -1437,8 +1613,7 @@ impl Node { #[derive(Debug)] pub enum ProxyDELETENodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENodeResponse { @@ -1462,8 +1637,20 @@ impl crate::Response for ProxyDELETENodeResponse { }; Ok((ProxyDELETENodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENodeResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENodeResponse::Other(result), read)) + }, } } } @@ -1503,8 +1690,7 @@ impl Node { #[derive(Debug)] pub enum ProxyDELETENodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENodeWithPathResponse { @@ -1528,8 +1714,20 @@ impl crate::Response for ProxyDELETENodeWithPathResponse { }; Ok((ProxyDELETENodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENodeWithPathResponse::Other(result), read)) + }, } } } @@ -1564,8 +1762,7 @@ impl Node { #[derive(Debug)] pub enum ProxyGETNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNodeResponse { @@ -1589,8 +1786,20 @@ impl crate::Response for ProxyGETNodeResponse { }; Ok((ProxyGETNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNodeResponse::Other(result), read)) + }, } } } @@ -1630,8 +1839,7 @@ impl Node { #[derive(Debug)] pub enum ProxyGETNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNodeWithPathResponse { @@ -1655,8 +1863,20 @@ impl crate::Response for ProxyGETNodeWithPathResponse { }; Ok((ProxyGETNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1691,8 +1911,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPATCHNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNodeResponse { @@ -1716,8 +1935,20 @@ impl crate::Response for ProxyPATCHNodeResponse { }; Ok((ProxyPATCHNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNodeResponse::Other(result), read)) + }, } } } @@ -1757,8 +1988,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPATCHNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNodeWithPathResponse { @@ -1782,8 +2012,20 @@ impl crate::Response for ProxyPATCHNodeWithPathResponse { }; Ok((ProxyPATCHNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1818,8 +2060,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPOSTNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNodeResponse { @@ -1843,8 +2084,20 @@ impl crate::Response for ProxyPOSTNodeResponse { }; Ok((ProxyPOSTNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNodeResponse::Other(result), read)) + }, } } } @@ -1884,8 +2137,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPOSTNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNodeWithPathResponse { @@ -1909,8 +2161,20 @@ impl crate::Response for ProxyPOSTNodeWithPathResponse { }; Ok((ProxyPOSTNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNodeWithPathResponse::Other(result), read)) + }, } } } @@ -1945,8 +2209,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPUTNodeResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNodeResponse { @@ -1970,8 +2233,20 @@ impl crate::Response for ProxyPUTNodeResponse { }; Ok((ProxyPUTNodeResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNodeResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNodeResponse::Other(result), read)) + }, } } } @@ -2011,8 +2286,7 @@ impl Node { #[derive(Debug)] pub enum ProxyPUTNodeWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNodeWithPathResponse { @@ -2036,8 +2310,20 @@ impl crate::Response for ProxyPUTNodeWithPathResponse { }; Ok((ProxyPUTNodeWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNodeWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNodeWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNodeWithPathResponse::Other(result), read)) + }, } } } @@ -2104,8 +2390,7 @@ pub struct ReadNodeOptional<'a> { #[derive(Debug)] pub enum ReadNodeResponse { Ok(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeResponse { @@ -2119,8 +2404,20 @@ impl crate::Response for ReadNodeResponse { }; Ok((ReadNodeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeResponse::Unauthorized, 0)), - _ => Ok((ReadNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeResponse::Other(result), read)) + }, } } } @@ -2175,8 +2472,7 @@ pub struct ReadNodeStatusOptional<'a> { #[derive(Debug)] pub enum ReadNodeStatusResponse { Ok(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNodeStatusResponse { @@ -2190,8 +2486,20 @@ impl crate::Response for ReadNodeStatusResponse { }; Ok((ReadNodeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNodeStatusResponse::Other(result), read)) + }, } } } @@ -2250,8 +2558,7 @@ pub struct ReplaceNodeOptional<'a> { pub enum ReplaceNodeResponse { Ok(crate::v1_9::api::core::v1::Node), Created(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeResponse { @@ -2273,8 +2580,20 @@ impl crate::Response for ReplaceNodeResponse { }; Ok((ReplaceNodeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeResponse::Other(result), read)) + }, } } } @@ -2333,8 +2652,7 @@ pub struct ReplaceNodeStatusOptional<'a> { pub enum ReplaceNodeStatusResponse { Ok(crate::v1_9::api::core::v1::Node), Created(crate::v1_9::api::core::v1::Node), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNodeStatusResponse { @@ -2356,8 +2674,20 @@ impl crate::Response for ReplaceNodeStatusResponse { }; Ok((ReplaceNodeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNodeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNodeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNodeStatusResponse::Other(result), read)) + }, } } } @@ -2423,8 +2753,7 @@ impl Node { #[derive(Debug)] pub enum WatchNodeResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNodeResponse { @@ -2440,8 +2769,20 @@ impl crate::Response for WatchNodeResponse { }; Ok((WatchNodeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNodeResponse::Unauthorized, 0)), - _ => Ok((WatchNodeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNodeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/persistent_volume.rs b/src/v1_9/api/core/v1/persistent_volume.rs index 803dd7394b..29007bf877 100644 --- a/src/v1_9/api/core/v1/persistent_volume.rs +++ b/src/v1_9/api/core/v1/persistent_volume.rs @@ -65,8 +65,7 @@ pub enum CreatePersistentVolumeResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), Created(crate::v1_9::api::core::v1::PersistentVolume), Accepted(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePersistentVolumeResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreatePersistentVolumeResponse { }; Ok((CreatePersistentVolumeResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((CreatePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -198,8 +209,7 @@ pub struct DeleteCollectionPersistentVolumeOptional<'a> { pub enum DeleteCollectionPersistentVolumeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPersistentVolumeResponse { @@ -226,8 +236,20 @@ impl crate::Response for DeleteCollectionPersistentVolumeResponse { Ok((DeleteCollectionPersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeletePersistentVolumeOptional<'a> { pub enum DeletePersistentVolumeResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePersistentVolumeResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeletePersistentVolumeResponse { Ok((DeletePersistentVolumeResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((DeletePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum ListPersistentVolumeResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListPersistentVolumeResponse { }; Ok((ListPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchPersistentVolumeResponse { }; Ok((PatchPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -551,8 +606,7 @@ pub struct PatchPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum PatchPersistentVolumeStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPersistentVolumeStatusResponse { @@ -566,8 +620,20 @@ impl crate::Response for PatchPersistentVolumeStatusResponse { }; Ok((PatchPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((PatchPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReadPersistentVolumeOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeResponse { @@ -649,8 +714,20 @@ impl crate::Response for ReadPersistentVolumeResponse { }; Ok((ReadPersistentVolumeResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeResponse::Other(result), read)) + }, } } } @@ -705,8 +782,7 @@ pub struct ReadPersistentVolumeStatusOptional<'a> { #[derive(Debug)] pub enum ReadPersistentVolumeStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPersistentVolumeStatusResponse { @@ -720,8 +796,20 @@ impl crate::Response for ReadPersistentVolumeStatusResponse { }; Ok((ReadPersistentVolumeStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReadPersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -780,8 +868,7 @@ pub struct ReplacePersistentVolumeOptional<'a> { pub enum ReplacePersistentVolumeResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), Created(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeResponse { @@ -803,8 +890,20 @@ impl crate::Response for ReplacePersistentVolumeResponse { }; Ok((ReplacePersistentVolumeResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeResponse::Other(result), read)) + }, } } } @@ -863,8 +962,7 @@ pub struct ReplacePersistentVolumeStatusOptional<'a> { pub enum ReplacePersistentVolumeStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolume), Created(crate::v1_9::api::core::v1::PersistentVolume), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePersistentVolumeStatusResponse { @@ -886,8 +984,20 @@ impl crate::Response for ReplacePersistentVolumeStatusResponse { }; Ok((ReplacePersistentVolumeStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePersistentVolumeStatusResponse::Unauthorized, 0)), - _ => Ok((ReplacePersistentVolumeStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePersistentVolumeStatusResponse::Other(result), read)) + }, } } } @@ -953,8 +1063,7 @@ impl PersistentVolume { #[derive(Debug)] pub enum WatchPersistentVolumeResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeResponse { @@ -970,8 +1079,20 @@ impl crate::Response for WatchPersistentVolumeResponse { }; Ok((WatchPersistentVolumeResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/persistent_volume_claim.rs b/src/v1_9/api/core/v1/persistent_volume_claim.rs index 7589667225..895fb6e515 100644 --- a/src/v1_9/api/core/v1/persistent_volume_claim.rs +++ b/src/v1_9/api/core/v1/persistent_volume_claim.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), Created(crate::v1_9::api::core::v1::PersistentVolumeClaim), Accepted(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedPersistentVolumeClaimResponse { }; Ok((CreateNamespacedPersistentVolumeClaimResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteCollectionNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedPersistentVolumeClaimResponse Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedPersistentVolumeClaimOptional<'a> { pub enum DeleteNamespacedPersistentVolumeClaimResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedPersistentVolumeClaimResponse { Ok((DeleteNamespacedPersistentVolumeClaimResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedPersistentVolumeClaimResponse { }; Ok((ListNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum ListPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaimList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListPersistentVolumeClaimForAllNamespacesResponse { }; Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimResponse { }; Ok((PatchNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedPersistentVolumeClaimStatusResponse { }; Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedPersistentVolumeClaimOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimResponse { }; Ok((ReadNamespacedPersistentVolumeClaimResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedPersistentVolumeClaimStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), Created(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedPersistentVolumeClaimStatusOptional<'a> { pub enum ReplaceNamespacedPersistentVolumeClaimStatusResponse { Ok(crate::v1_9::api::core::v1::PersistentVolumeClaim), Created(crate::v1_9::api::core::v1::PersistentVolumeClaim), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedPersistentVolumeClaimStatusResponse { }; Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPersistentVolumeClaimStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchNamespacedPersistentVolumeClaimResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedPersistentVolumeClaimResponse { }; Ok((WatchNamespacedPersistentVolumeClaimResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPersistentVolumeClaimResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPersistentVolumeClaimResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPersistentVolumeClaimResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl PersistentVolumeClaim { #[derive(Debug)] pub enum WatchPersistentVolumeClaimForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchPersistentVolumeClaimForAllNamespacesResponse { }; Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPersistentVolumeClaimForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/pod.rs b/src/v1_9/api/core/v1/pod.rs index a1d195078c..6705a0a9b3 100644 --- a/src/v1_9/api/core/v1/pod.rs +++ b/src/v1_9/api/core/v1/pod.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyResponse { }; Ok((ConnectDeleteNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedPodProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -271,8 +293,7 @@ pub struct ConnectGetNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodAttachResponse { @@ -296,8 +317,20 @@ impl crate::Response for ConnectGetNamespacedPodAttachResponse { }; Ok((ConnectGetNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -387,8 +420,7 @@ pub struct ConnectGetNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodExecResponse { @@ -412,8 +444,20 @@ impl crate::Response for ConnectGetNamespacedPodExecResponse { }; Ok((ConnectGetNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -473,8 +517,7 @@ pub struct ConnectGetNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectGetNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { @@ -498,8 +541,20 @@ impl crate::Response for ConnectGetNamespacedPodPortforwardResponse { }; Ok((ConnectGetNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ConnectGetNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyResponse { @@ -584,8 +638,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyResponse { }; Ok((ConnectGetNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -650,8 +716,7 @@ pub struct ConnectGetNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { @@ -675,8 +740,20 @@ impl crate::Response for ConnectGetNamespacedPodProxyWithPathResponse { }; Ok((ConnectGetNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -736,8 +813,7 @@ pub struct ConnectPatchNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyResponse { @@ -761,8 +837,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyResponse { }; Ok((ConnectPatchNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -827,8 +915,7 @@ pub struct ConnectPatchNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { @@ -852,8 +939,20 @@ impl crate::Response for ConnectPatchNamespacedPodProxyWithPathResponse { }; Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -937,8 +1036,7 @@ pub struct ConnectPostNamespacedPodAttachOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodAttachResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodAttachResponse { @@ -962,8 +1060,20 @@ impl crate::Response for ConnectPostNamespacedPodAttachResponse { }; Ok((ConnectPostNamespacedPodAttachResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodAttachResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodAttachResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodAttachResponse::Other(result), read)) + }, } } } @@ -1053,8 +1163,7 @@ pub struct ConnectPostNamespacedPodExecOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodExecResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodExecResponse { @@ -1078,8 +1187,20 @@ impl crate::Response for ConnectPostNamespacedPodExecResponse { }; Ok((ConnectPostNamespacedPodExecResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodExecResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodExecResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodExecResponse::Other(result), read)) + }, } } } @@ -1139,8 +1260,7 @@ pub struct ConnectPostNamespacedPodPortforwardOptional { #[derive(Debug)] pub enum ConnectPostNamespacedPodPortforwardResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { @@ -1164,8 +1284,20 @@ impl crate::Response for ConnectPostNamespacedPodPortforwardResponse { }; Ok((ConnectPostNamespacedPodPortforwardResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodPortforwardResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodPortforwardResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodPortforwardResponse::Other(result), read)) + }, } } } @@ -1225,8 +1357,7 @@ pub struct ConnectPostNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyResponse { @@ -1250,8 +1381,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyResponse { }; Ok((ConnectPostNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1316,8 +1459,7 @@ pub struct ConnectPostNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { @@ -1341,8 +1483,20 @@ impl crate::Response for ConnectPostNamespacedPodProxyWithPathResponse { }; Ok((ConnectPostNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1402,8 +1556,7 @@ pub struct ConnectPutNamespacedPodProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyResponse { @@ -1427,8 +1580,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyResponse { }; Ok((ConnectPutNamespacedPodProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyResponse::Other(result), read)) + }, } } } @@ -1493,8 +1658,7 @@ pub struct ConnectPutNamespacedPodProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedPodProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { @@ -1518,8 +1682,20 @@ impl crate::Response for ConnectPutNamespacedPodProxyWithPathResponse { }; Ok((ConnectPutNamespacedPodProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedPodProxyWithPathResponse::Other(result), read)) + }, } } } @@ -1579,8 +1755,7 @@ pub enum CreateNamespacedPodResponse { Ok(crate::v1_9::api::core::v1::Pod), Created(crate::v1_9::api::core::v1::Pod), Accepted(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodResponse { @@ -1610,8 +1785,20 @@ impl crate::Response for CreateNamespacedPodResponse { }; Ok((CreateNamespacedPodResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1717,8 +1904,7 @@ pub struct DeleteCollectionNamespacedPodOptional<'a> { pub enum DeleteCollectionNamespacedPodResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodResponse { @@ -1745,8 +1931,20 @@ impl crate::Response for DeleteCollectionNamespacedPodResponse { Ok((DeleteCollectionNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1825,8 +2023,7 @@ pub struct DeleteNamespacedPodOptional<'a> { pub enum DeleteNamespacedPodResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodResponse { @@ -1853,8 +2050,20 @@ impl crate::Response for DeleteNamespacedPodResponse { Ok((DeleteNamespacedPodResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodResponse::Other(result), read)) + }, } } } @@ -1932,8 +2141,7 @@ impl Pod { #[derive(Debug)] pub enum ListNamespacedPodResponse { Ok(crate::v1_9::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodResponse { @@ -1947,8 +2155,20 @@ impl crate::Response for ListNamespacedPodResponse { }; Ok((ListNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2021,8 +2241,7 @@ impl Pod { #[derive(Debug)] pub enum ListPodForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::PodList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodForAllNamespacesResponse { @@ -2036,8 +2255,20 @@ impl crate::Response for ListPodForAllNamespacesResponse { }; Ok((ListPodForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -2100,8 +2331,7 @@ pub struct PatchNamespacedPodOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodResponse { Ok(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodResponse { @@ -2115,8 +2345,20 @@ impl crate::Response for PatchNamespacedPodResponse { }; Ok((PatchNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2179,8 +2421,7 @@ pub struct PatchNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodStatusResponse { Ok(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodStatusResponse { @@ -2194,8 +2435,20 @@ impl crate::Response for PatchNamespacedPodStatusResponse { }; Ok((PatchNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -2235,8 +2488,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyDELETENamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedPodResponse { @@ -2260,8 +2512,20 @@ impl crate::Response for ProxyDELETENamespacedPodResponse { }; Ok((ProxyDELETENamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedPodResponse::Other(result), read)) + }, } } } @@ -2306,8 +2570,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyDELETENamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedPodWithPathResponse { @@ -2331,8 +2594,20 @@ impl crate::Response for ProxyDELETENamespacedPodWithPathResponse { }; Ok((ProxyDELETENamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2372,8 +2647,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyGETNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedPodResponse { @@ -2397,8 +2671,20 @@ impl crate::Response for ProxyGETNamespacedPodResponse { }; Ok((ProxyGETNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2443,8 +2729,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyGETNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedPodWithPathResponse { @@ -2468,8 +2753,20 @@ impl crate::Response for ProxyGETNamespacedPodWithPathResponse { }; Ok((ProxyGETNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2509,8 +2806,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPATCHNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedPodResponse { @@ -2534,8 +2830,20 @@ impl crate::Response for ProxyPATCHNamespacedPodResponse { }; Ok((ProxyPATCHNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2580,8 +2888,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPATCHNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedPodWithPathResponse { @@ -2605,8 +2912,20 @@ impl crate::Response for ProxyPATCHNamespacedPodWithPathResponse { }; Ok((ProxyPATCHNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2646,8 +2965,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPOSTNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedPodResponse { @@ -2671,8 +2989,20 @@ impl crate::Response for ProxyPOSTNamespacedPodResponse { }; Ok((ProxyPOSTNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2717,8 +3047,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPOSTNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedPodWithPathResponse { @@ -2742,8 +3071,20 @@ impl crate::Response for ProxyPOSTNamespacedPodWithPathResponse { }; Ok((ProxyPOSTNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2783,8 +3124,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPUTNamespacedPodResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedPodResponse { @@ -2808,8 +3148,20 @@ impl crate::Response for ProxyPUTNamespacedPodResponse { }; Ok((ProxyPUTNamespacedPodResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedPodResponse::Other(result), read)) + }, } } } @@ -2854,8 +3206,7 @@ impl Pod { #[derive(Debug)] pub enum ProxyPUTNamespacedPodWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedPodWithPathResponse { @@ -2879,8 +3230,20 @@ impl crate::Response for ProxyPUTNamespacedPodWithPathResponse { }; Ok((ProxyPUTNamespacedPodWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedPodWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedPodWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedPodWithPathResponse::Other(result), read)) + }, } } } @@ -2952,8 +3315,7 @@ pub struct ReadNamespacedPodOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodResponse { Ok(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodResponse { @@ -2967,8 +3329,20 @@ impl crate::Response for ReadNamespacedPodResponse { }; Ok((ReadNamespacedPodResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3070,8 +3444,7 @@ pub struct ReadNamespacedPodLogOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodLogResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodLogResponse { @@ -3095,8 +3468,20 @@ impl crate::Response for ReadNamespacedPodLogResponse { }; Ok((ReadNamespacedPodLogResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodLogResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodLogResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodLogResponse::Other(result), read)) + }, } } } @@ -3156,8 +3541,7 @@ pub struct ReadNamespacedPodStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodStatusResponse { Ok(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodStatusResponse { @@ -3171,8 +3555,20 @@ impl crate::Response for ReadNamespacedPodStatusResponse { }; Ok((ReadNamespacedPodStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -3236,8 +3632,7 @@ pub struct ReplaceNamespacedPodOptional<'a> { pub enum ReplaceNamespacedPodResponse { Ok(crate::v1_9::api::core::v1::Pod), Created(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodResponse { @@ -3259,8 +3654,20 @@ impl crate::Response for ReplaceNamespacedPodResponse { }; Ok((ReplaceNamespacedPodResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3324,8 +3731,7 @@ pub struct ReplaceNamespacedPodStatusOptional<'a> { pub enum ReplaceNamespacedPodStatusResponse { Ok(crate::v1_9::api::core::v1::Pod), Created(crate::v1_9::api::core::v1::Pod), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodStatusResponse { @@ -3347,8 +3753,20 @@ impl crate::Response for ReplaceNamespacedPodStatusResponse { }; Ok((ReplaceNamespacedPodStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodStatusResponse::Other(result), read)) + }, } } } @@ -3419,8 +3837,7 @@ impl Pod { #[derive(Debug)] pub enum WatchNamespacedPodResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodResponse { @@ -3436,8 +3853,20 @@ impl crate::Response for WatchNamespacedPodResponse { }; Ok((WatchNamespacedPodResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodResponse::Other(result), read)) + }, } } } @@ -3503,8 +3932,7 @@ impl Pod { #[derive(Debug)] pub enum WatchPodForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodForAllNamespacesResponse { @@ -3520,8 +3948,20 @@ impl crate::Response for WatchPodForAllNamespacesResponse { }; Ok((WatchPodForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/pod_template.rs b/src/v1_9/api/core/v1/pod_template.rs index 1ed37a6de3..03845b37f0 100644 --- a/src/v1_9/api/core/v1/pod_template.rs +++ b/src/v1_9/api/core/v1/pod_template.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedPodTemplateResponse { Ok(crate::v1_9::api::core::v1::PodTemplate), Created(crate::v1_9::api::core::v1::PodTemplate), Accepted(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodTemplateResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedPodTemplateResponse { }; Ok((CreateNamespacedPodTemplateResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedPodTemplateOptional<'a> { pub enum DeleteCollectionNamespacedPodTemplateResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedPodTemplateResponse { Ok((DeleteCollectionNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedPodTemplateOptional<'a> { pub enum DeleteNamespacedPodTemplateResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodTemplateResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedPodTemplateResponse { Ok((DeleteNamespacedPodTemplateResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListNamespacedPodTemplateResponse { Ok(crate::v1_9::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodTemplateResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedPodTemplateResponse { }; Ok((ListNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl PodTemplate { #[derive(Debug)] pub enum ListPodTemplateForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::PodTemplateList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodTemplateForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListPodTemplateForAllNamespacesResponse { }; Ok((ListPodTemplateForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodTemplateResponse { Ok(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodTemplateResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedPodTemplateResponse { }; Ok((PatchNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedPodTemplateOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodTemplateResponse { Ok(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodTemplateResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedPodTemplateResponse { }; Ok((ReadNamespacedPodTemplateResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedPodTemplateOptional<'a> { pub enum ReplaceNamespacedPodTemplateResponse { Ok(crate::v1_9::api::core::v1::PodTemplate), Created(crate::v1_9::api::core::v1::PodTemplate), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodTemplateResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedPodTemplateResponse { }; Ok((ReplaceNamespacedPodTemplateResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchNamespacedPodTemplateResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodTemplateResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedPodTemplateResponse { }; Ok((WatchNamespacedPodTemplateResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodTemplateResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodTemplateResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodTemplateResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl PodTemplate { #[derive(Debug)] pub enum WatchPodTemplateForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodTemplateForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchPodTemplateForAllNamespacesResponse { }; Ok((WatchPodTemplateForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodTemplateForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodTemplateForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodTemplateForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/replication_controller.rs b/src/v1_9/api/core/v1/replication_controller.rs index 2f26407b28..0ff1174d4c 100644 --- a/src/v1_9/api/core/v1/replication_controller.rs +++ b/src/v1_9/api/core/v1/replication_controller.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicationControllerResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), Created(crate::v1_9::api::core::v1::ReplicationController), Accepted(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicationControllerResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicationControllerResponse { }; Ok((CreateNamespacedReplicationControllerResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicationControllerOptional<'a> { pub enum DeleteCollectionNamespacedReplicationControllerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicationControllerResponse Ok((DeleteCollectionNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicationControllerOptional<'a> { pub enum DeleteNamespacedReplicationControllerResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicationControllerResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicationControllerResponse { Ok((DeleteNamespacedReplicationControllerResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListNamespacedReplicationControllerResponse { Ok(crate::v1_9::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicationControllerResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicationControllerResponse { }; Ok((ListNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicationController { #[derive(Debug)] pub enum ListReplicationControllerForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::ReplicationControllerList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicationControllerForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicationControllerForAllNamespacesResponse { }; Ok((ListReplicationControllerForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicationControllerResponse { }; Ok((PatchNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerStatusResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicationControllerStatusResponse { }; Ok((PatchNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicationControllerOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicationControllerResponse { }; Ok((ReadNamespacedReplicationControllerResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicationControllerStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerStatusResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicationControllerStatusResponse { }; Ok((ReadNamespacedReplicationControllerStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicationControllerOptional<'a> { pub enum ReplaceNamespacedReplicationControllerResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), Created(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerResponse { }; Ok((ReplaceNamespacedReplicationControllerResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicationControllerStatusOptional<'a> { pub enum ReplaceNamespacedReplicationControllerStatusResponse { Ok(crate::v1_9::api::core::v1::ReplicationController), Created(crate::v1_9::api::core::v1::ReplicationController), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerStatusResponse { }; Ok((ReplaceNamespacedReplicationControllerStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchNamespacedReplicationControllerResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicationControllerResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicationControllerResponse { }; Ok((WatchNamespacedReplicationControllerResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicationControllerResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicationControllerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicationControllerResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicationController { #[derive(Debug)] pub enum WatchReplicationControllerForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicationControllerForAllNamespacesResponse { }; Ok((WatchReplicationControllerForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicationControllerForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicationControllerForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicationControllerForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/resource_quota.rs b/src/v1_9/api/core/v1/resource_quota.rs index 9a91d9dfeb..68ec73a4e1 100644 --- a/src/v1_9/api/core/v1/resource_quota.rs +++ b/src/v1_9/api/core/v1/resource_quota.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedResourceQuotaResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), Created(crate::v1_9::api::core::v1::ResourceQuota), Accepted(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedResourceQuotaResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedResourceQuotaResponse { }; Ok((CreateNamespacedResourceQuotaResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedResourceQuotaOptional<'a> { pub enum DeleteCollectionNamespacedResourceQuotaResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedResourceQuotaResponse { Ok((DeleteCollectionNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedResourceQuotaOptional<'a> { pub enum DeleteNamespacedResourceQuotaResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedResourceQuotaResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedResourceQuotaResponse { Ok((DeleteNamespacedResourceQuotaResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListNamespacedResourceQuotaResponse { Ok(crate::v1_9::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedResourceQuotaResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedResourceQuotaResponse { }; Ok((ListNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum ListResourceQuotaForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::ResourceQuotaList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListResourceQuotaForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListResourceQuotaForAllNamespacesResponse { }; Ok((ListResourceQuotaForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedResourceQuotaResponse { }; Ok((PatchNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedResourceQuotaStatusResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedResourceQuotaStatusResponse { }; Ok((PatchNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedResourceQuotaOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedResourceQuotaResponse { }; Ok((ReadNamespacedResourceQuotaResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedResourceQuotaStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedResourceQuotaStatusResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedResourceQuotaStatusResponse { }; Ok((ReadNamespacedResourceQuotaStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedResourceQuotaOptional<'a> { pub enum ReplaceNamespacedResourceQuotaResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), Created(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaResponse { }; Ok((ReplaceNamespacedResourceQuotaResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedResourceQuotaStatusOptional<'a> { pub enum ReplaceNamespacedResourceQuotaStatusResponse { Ok(crate::v1_9::api::core::v1::ResourceQuota), Created(crate::v1_9::api::core::v1::ResourceQuota), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedResourceQuotaStatusResponse { }; Ok((ReplaceNamespacedResourceQuotaStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedResourceQuotaStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchNamespacedResourceQuotaResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedResourceQuotaResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedResourceQuotaResponse { }; Ok((WatchNamespacedResourceQuotaResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedResourceQuotaResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedResourceQuotaResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedResourceQuotaResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ResourceQuota { #[derive(Debug)] pub enum WatchResourceQuotaForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchResourceQuotaForAllNamespacesResponse { }; Ok((WatchResourceQuotaForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchResourceQuotaForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchResourceQuotaForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchResourceQuotaForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/secret.rs b/src/v1_9/api/core/v1/secret.rs index cf4254215d..456d4a6cea 100644 --- a/src/v1_9/api/core/v1/secret.rs +++ b/src/v1_9/api/core/v1/secret.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedSecretResponse { Ok(crate::v1_9::api::core::v1::Secret), Created(crate::v1_9::api::core::v1::Secret), Accepted(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedSecretResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedSecretResponse { }; Ok((CreateNamespacedSecretResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedSecretOptional<'a> { pub enum DeleteCollectionNamespacedSecretResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedSecretResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedSecretResponse { Ok((DeleteCollectionNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedSecretOptional<'a> { pub enum DeleteNamespacedSecretResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedSecretResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedSecretResponse { Ok((DeleteNamespacedSecretResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl Secret { #[derive(Debug)] pub enum ListNamespacedSecretResponse { Ok(crate::v1_9::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedSecretResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedSecretResponse { }; Ok((ListNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl Secret { #[derive(Debug)] pub enum ListSecretForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::SecretList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListSecretForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListSecretForAllNamespacesResponse { }; Ok((ListSecretForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListSecretForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedSecretResponse { Ok(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedSecretResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedSecretResponse { }; Ok((PatchNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedSecretOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedSecretResponse { Ok(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedSecretResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedSecretResponse { }; Ok((ReadNamespacedSecretResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedSecretOptional<'a> { pub enum ReplaceNamespacedSecretResponse { Ok(crate::v1_9::api::core::v1::Secret), Created(crate::v1_9::api::core::v1::Secret), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedSecretResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedSecretResponse { }; Ok((ReplaceNamespacedSecretResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl Secret { #[derive(Debug)] pub enum WatchNamespacedSecretResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedSecretResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedSecretResponse { }; Ok((WatchNamespacedSecretResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedSecretResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedSecretResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedSecretResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl Secret { #[derive(Debug)] pub enum WatchSecretForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchSecretForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchSecretForAllNamespacesResponse { }; Ok((WatchSecretForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchSecretForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchSecretForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchSecretForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/service.rs b/src/v1_9/api/core/v1/service.rs index 14812cda2c..849dc2c838 100644 --- a/src/v1_9/api/core/v1/service.rs +++ b/src/v1_9/api/core/v1/service.rs @@ -70,8 +70,7 @@ pub struct ConnectDeleteNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { @@ -95,8 +94,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyResponse { }; Ok((ConnectDeleteNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -161,8 +172,7 @@ pub struct ConnectDeleteNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectDeleteNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { @@ -186,8 +196,20 @@ impl crate::Response for ConnectDeleteNamespacedServiceProxyWithPathResponse { }; Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectDeleteNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -247,8 +269,7 @@ pub struct ConnectGetNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyResponse { @@ -272,8 +293,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyResponse { }; Ok((ConnectGetNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -338,8 +371,7 @@ pub struct ConnectGetNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectGetNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { @@ -363,8 +395,20 @@ impl crate::Response for ConnectGetNamespacedServiceProxyWithPathResponse { }; Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectGetNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -424,8 +468,7 @@ pub struct ConnectPatchNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { @@ -449,8 +492,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyResponse { }; Ok((ConnectPatchNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -515,8 +570,7 @@ pub struct ConnectPatchNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPatchNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { @@ -540,8 +594,20 @@ impl crate::Response for ConnectPatchNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPatchNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -601,8 +667,7 @@ pub struct ConnectPostNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyResponse { @@ -626,8 +691,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyResponse { }; Ok((ConnectPostNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -692,8 +769,7 @@ pub struct ConnectPostNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPostNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { @@ -717,8 +793,20 @@ impl crate::Response for ConnectPostNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPostNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -778,8 +866,7 @@ pub struct ConnectPutNamespacedServiceProxyOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyResponse { @@ -803,8 +890,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyResponse { }; Ok((ConnectPutNamespacedServiceProxyResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyResponse::Other(result), read)) + }, } } } @@ -869,8 +968,7 @@ pub struct ConnectPutNamespacedServiceProxyWithPathOptional<'a> { #[derive(Debug)] pub enum ConnectPutNamespacedServiceProxyWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { @@ -894,8 +992,20 @@ impl crate::Response for ConnectPutNamespacedServiceProxyWithPathResponse { }; Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Unauthorized, 0)), - _ => Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ConnectPutNamespacedServiceProxyWithPathResponse::Other(result), read)) + }, } } } @@ -955,8 +1065,7 @@ pub enum CreateNamespacedServiceResponse { Ok(crate::v1_9::api::core::v1::Service), Created(crate::v1_9::api::core::v1::Service), Accepted(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceResponse { @@ -986,8 +1095,20 @@ impl crate::Response for CreateNamespacedServiceResponse { }; Ok((CreateNamespacedServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1048,8 +1169,7 @@ pub struct DeleteNamespacedServiceOptional<'a> { pub enum DeleteNamespacedServiceResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceResponse { @@ -1076,8 +1196,20 @@ impl crate::Response for DeleteNamespacedServiceResponse { Ok((DeleteNamespacedServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1155,8 +1287,7 @@ impl Service { #[derive(Debug)] pub enum ListNamespacedServiceResponse { Ok(crate::v1_9::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceResponse { @@ -1170,8 +1301,20 @@ impl crate::Response for ListNamespacedServiceResponse { }; Ok((ListNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1244,8 +1387,7 @@ impl Service { #[derive(Debug)] pub enum ListServiceForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::ServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceForAllNamespacesResponse { @@ -1259,8 +1401,20 @@ impl crate::Response for ListServiceForAllNamespacesResponse { }; Ok((ListServiceForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1323,8 +1477,7 @@ pub struct PatchNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceResponse { Ok(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceResponse { @@ -1338,8 +1491,20 @@ impl crate::Response for PatchNamespacedServiceResponse { }; Ok((PatchNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1402,8 +1567,7 @@ pub struct PatchNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceStatusResponse { Ok(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceStatusResponse { @@ -1417,8 +1581,20 @@ impl crate::Response for PatchNamespacedServiceStatusResponse { }; Ok((PatchNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -1458,8 +1634,7 @@ impl Service { #[derive(Debug)] pub enum ProxyDELETENamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedServiceResponse { @@ -1483,8 +1658,20 @@ impl crate::Response for ProxyDELETENamespacedServiceResponse { }; Ok((ProxyDELETENamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1529,8 +1716,7 @@ impl Service { #[derive(Debug)] pub enum ProxyDELETENamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyDELETENamespacedServiceWithPathResponse { @@ -1554,8 +1740,20 @@ impl crate::Response for ProxyDELETENamespacedServiceWithPathResponse { }; Ok((ProxyDELETENamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyDELETENamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyDELETENamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyDELETENamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1595,8 +1793,7 @@ impl Service { #[derive(Debug)] pub enum ProxyGETNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedServiceResponse { @@ -1620,8 +1817,20 @@ impl crate::Response for ProxyGETNamespacedServiceResponse { }; Ok((ProxyGETNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1666,8 +1875,7 @@ impl Service { #[derive(Debug)] pub enum ProxyGETNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyGETNamespacedServiceWithPathResponse { @@ -1691,8 +1899,20 @@ impl crate::Response for ProxyGETNamespacedServiceWithPathResponse { }; Ok((ProxyGETNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyGETNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyGETNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyGETNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1732,8 +1952,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPATCHNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedServiceResponse { @@ -1757,8 +1976,20 @@ impl crate::Response for ProxyPATCHNamespacedServiceResponse { }; Ok((ProxyPATCHNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1803,8 +2034,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPATCHNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPATCHNamespacedServiceWithPathResponse { @@ -1828,8 +2058,20 @@ impl crate::Response for ProxyPATCHNamespacedServiceWithPathResponse { }; Ok((ProxyPATCHNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPATCHNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPATCHNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPATCHNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -1869,8 +2111,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPOSTNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedServiceResponse { @@ -1894,8 +2135,20 @@ impl crate::Response for ProxyPOSTNamespacedServiceResponse { }; Ok((ProxyPOSTNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -1940,8 +2193,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPOSTNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPOSTNamespacedServiceWithPathResponse { @@ -1965,8 +2217,20 @@ impl crate::Response for ProxyPOSTNamespacedServiceWithPathResponse { }; Ok((ProxyPOSTNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPOSTNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPOSTNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPOSTNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -2006,8 +2270,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPUTNamespacedServiceResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedServiceResponse { @@ -2031,8 +2294,20 @@ impl crate::Response for ProxyPUTNamespacedServiceResponse { }; Ok((ProxyPUTNamespacedServiceResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2077,8 +2352,7 @@ impl Service { #[derive(Debug)] pub enum ProxyPUTNamespacedServiceWithPathResponse { Ok(String), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ProxyPUTNamespacedServiceWithPathResponse { @@ -2102,8 +2376,20 @@ impl crate::Response for ProxyPUTNamespacedServiceWithPathResponse { }; Ok((ProxyPUTNamespacedServiceWithPathResponse::Ok(result.to_string()), len)) }, - http::StatusCode::UNAUTHORIZED => Ok((ProxyPUTNamespacedServiceWithPathResponse::Unauthorized, 0)), - _ => Ok((ProxyPUTNamespacedServiceWithPathResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ProxyPUTNamespacedServiceWithPathResponse::Other(result), read)) + }, } } } @@ -2175,8 +2461,7 @@ pub struct ReadNamespacedServiceOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceResponse { Ok(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceResponse { @@ -2190,8 +2475,20 @@ impl crate::Response for ReadNamespacedServiceResponse { }; Ok((ReadNamespacedServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2251,8 +2548,7 @@ pub struct ReadNamespacedServiceStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceStatusResponse { Ok(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceStatusResponse { @@ -2266,8 +2562,20 @@ impl crate::Response for ReadNamespacedServiceStatusResponse { }; Ok((ReadNamespacedServiceStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -2331,8 +2639,7 @@ pub struct ReplaceNamespacedServiceOptional<'a> { pub enum ReplaceNamespacedServiceResponse { Ok(crate::v1_9::api::core::v1::Service), Created(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceResponse { @@ -2354,8 +2661,20 @@ impl crate::Response for ReplaceNamespacedServiceResponse { }; Ok((ReplaceNamespacedServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2419,8 +2738,7 @@ pub struct ReplaceNamespacedServiceStatusOptional<'a> { pub enum ReplaceNamespacedServiceStatusResponse { Ok(crate::v1_9::api::core::v1::Service), Created(crate::v1_9::api::core::v1::Service), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceStatusResponse { @@ -2442,8 +2760,20 @@ impl crate::Response for ReplaceNamespacedServiceStatusResponse { }; Ok((ReplaceNamespacedServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceStatusResponse::Other(result), read)) + }, } } } @@ -2514,8 +2844,7 @@ impl Service { #[derive(Debug)] pub enum WatchNamespacedServiceResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceResponse { @@ -2531,8 +2860,20 @@ impl crate::Response for WatchNamespacedServiceResponse { }; Ok((WatchNamespacedServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceResponse::Other(result), read)) + }, } } } @@ -2598,8 +2939,7 @@ impl Service { #[derive(Debug)] pub enum WatchServiceForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceForAllNamespacesResponse { @@ -2615,8 +2955,20 @@ impl crate::Response for WatchServiceForAllNamespacesResponse { }; Ok((WatchServiceForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/core/v1/service_account.rs b/src/v1_9/api/core/v1/service_account.rs index ba8c235039..bbbed69ea2 100644 --- a/src/v1_9/api/core/v1/service_account.rs +++ b/src/v1_9/api/core/v1/service_account.rs @@ -73,8 +73,7 @@ pub enum CreateNamespacedServiceAccountResponse { Ok(crate::v1_9::api::core::v1::ServiceAccount), Created(crate::v1_9::api::core::v1::ServiceAccount), Accepted(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedServiceAccountResponse { @@ -104,8 +103,20 @@ impl crate::Response for CreateNamespacedServiceAccountResponse { }; Ok((CreateNamespacedServiceAccountResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -211,8 +222,7 @@ pub struct DeleteCollectionNamespacedServiceAccountOptional<'a> { pub enum DeleteCollectionNamespacedServiceAccountResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { @@ -239,8 +249,20 @@ impl crate::Response for DeleteCollectionNamespacedServiceAccountResponse { Ok((DeleteCollectionNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -319,8 +341,7 @@ pub struct DeleteNamespacedServiceAccountOptional<'a> { pub enum DeleteNamespacedServiceAccountResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedServiceAccountResponse { @@ -347,8 +368,20 @@ impl crate::Response for DeleteNamespacedServiceAccountResponse { Ok((DeleteNamespacedServiceAccountResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -426,8 +459,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListNamespacedServiceAccountResponse { Ok(crate::v1_9::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedServiceAccountResponse { @@ -441,8 +473,20 @@ impl crate::Response for ListNamespacedServiceAccountResponse { }; Ok((ListNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -515,8 +559,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum ListServiceAccountForAllNamespacesResponse { Ok(crate::v1_9::api::core::v1::ServiceAccountList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListServiceAccountForAllNamespacesResponse { @@ -530,8 +573,20 @@ impl crate::Response for ListServiceAccountForAllNamespacesResponse { }; Ok((ListServiceAccountForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -594,8 +649,7 @@ pub struct PatchNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedServiceAccountResponse { Ok(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedServiceAccountResponse { @@ -609,8 +663,20 @@ impl crate::Response for PatchNamespacedServiceAccountResponse { }; Ok((PatchNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -682,8 +748,7 @@ pub struct ReadNamespacedServiceAccountOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedServiceAccountResponse { Ok(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedServiceAccountResponse { @@ -697,8 +762,20 @@ impl crate::Response for ReadNamespacedServiceAccountResponse { }; Ok((ReadNamespacedServiceAccountResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -762,8 +839,7 @@ pub struct ReplaceNamespacedServiceAccountOptional<'a> { pub enum ReplaceNamespacedServiceAccountResponse { Ok(crate::v1_9::api::core::v1::ServiceAccount), Created(crate::v1_9::api::core::v1::ServiceAccount), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedServiceAccountResponse { @@ -785,8 +861,20 @@ impl crate::Response for ReplaceNamespacedServiceAccountResponse { }; Ok((ReplaceNamespacedServiceAccountResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -857,8 +945,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchNamespacedServiceAccountResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedServiceAccountResponse { @@ -874,8 +961,20 @@ impl crate::Response for WatchNamespacedServiceAccountResponse { }; Ok((WatchNamespacedServiceAccountResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedServiceAccountResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedServiceAccountResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedServiceAccountResponse::Other(result), read)) + }, } } } @@ -941,8 +1040,7 @@ impl ServiceAccount { #[derive(Debug)] pub enum WatchServiceAccountForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchServiceAccountForAllNamespacesResponse { @@ -958,8 +1056,20 @@ impl crate::Response for WatchServiceAccountForAllNamespacesResponse { }; Ok((WatchServiceAccountForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchServiceAccountForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchServiceAccountForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchServiceAccountForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/events/v1beta1/event.rs b/src/v1_9/api/events/v1beta1/event.rs index ee8151f83e..5624801369 100644 --- a/src/v1_9/api/events/v1beta1/event.rs +++ b/src/v1_9/api/events/v1beta1/event.rs @@ -105,8 +105,7 @@ pub enum CreateNamespacedEventResponse { Ok(crate::v1_9::api::events::v1beta1::Event), Created(crate::v1_9::api::events::v1beta1::Event), Accepted(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedEventResponse { @@ -136,8 +135,20 @@ impl crate::Response for CreateNamespacedEventResponse { }; Ok((CreateNamespacedEventResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedEventResponse::Other(result), read)) + }, } } } @@ -243,8 +254,7 @@ pub struct DeleteCollectionNamespacedEventOptional<'a> { pub enum DeleteCollectionNamespacedEventResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedEventResponse { @@ -271,8 +281,20 @@ impl crate::Response for DeleteCollectionNamespacedEventResponse { Ok((DeleteCollectionNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedEventResponse::Other(result), read)) + }, } } } @@ -351,8 +373,7 @@ pub struct DeleteNamespacedEventOptional<'a> { pub enum DeleteNamespacedEventResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedEventResponse { @@ -379,8 +400,20 @@ impl crate::Response for DeleteNamespacedEventResponse { Ok((DeleteNamespacedEventResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedEventResponse::Other(result), read)) + }, } } } @@ -453,8 +486,7 @@ impl Event { #[derive(Debug)] pub enum ListEventForAllNamespacesResponse { Ok(crate::v1_9::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListEventForAllNamespacesResponse { @@ -468,8 +500,20 @@ impl crate::Response for ListEventForAllNamespacesResponse { }; Ok((ListEventForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -547,8 +591,7 @@ impl Event { #[derive(Debug)] pub enum ListNamespacedEventResponse { Ok(crate::v1_9::api::events::v1beta1::EventList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedEventResponse { @@ -562,8 +605,20 @@ impl crate::Response for ListNamespacedEventResponse { }; Ok((ListNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedEventResponse::Other(result), read)) + }, } } } @@ -626,8 +681,7 @@ pub struct PatchNamespacedEventOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedEventResponse { Ok(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedEventResponse { @@ -641,8 +695,20 @@ impl crate::Response for PatchNamespacedEventResponse { }; Ok((PatchNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedEventResponse::Other(result), read)) + }, } } } @@ -714,8 +780,7 @@ pub struct ReadNamespacedEventOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedEventResponse { Ok(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedEventResponse { @@ -729,8 +794,20 @@ impl crate::Response for ReadNamespacedEventResponse { }; Ok((ReadNamespacedEventResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedEventResponse::Other(result), read)) + }, } } } @@ -794,8 +871,7 @@ pub struct ReplaceNamespacedEventOptional<'a> { pub enum ReplaceNamespacedEventResponse { Ok(crate::v1_9::api::events::v1beta1::Event), Created(crate::v1_9::api::events::v1beta1::Event), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedEventResponse { @@ -817,8 +893,20 @@ impl crate::Response for ReplaceNamespacedEventResponse { }; Ok((ReplaceNamespacedEventResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedEventResponse::Other(result), read)) + }, } } } @@ -884,8 +972,7 @@ impl Event { #[derive(Debug)] pub enum WatchEventForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchEventForAllNamespacesResponse { @@ -901,8 +988,20 @@ impl crate::Response for WatchEventForAllNamespacesResponse { }; Ok((WatchEventForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchEventForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchEventForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchEventForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -973,8 +1072,7 @@ impl Event { #[derive(Debug)] pub enum WatchNamespacedEventResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedEventResponse { @@ -990,8 +1088,20 @@ impl crate::Response for WatchNamespacedEventResponse { }; Ok((WatchNamespacedEventResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedEventResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedEventResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedEventResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/daemon_set.rs b/src/v1_9/api/extensions/v1beta1/daemon_set.rs index 71d937ec2e..2be3b2f355 100644 --- a/src/v1_9/api/extensions/v1beta1/daemon_set.rs +++ b/src/v1_9/api/extensions/v1beta1/daemon_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDaemonSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), Created(crate::v1_9::api::extensions::v1beta1::DaemonSet), Accepted(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDaemonSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDaemonSetResponse { }; Ok((CreateNamespacedDaemonSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDaemonSetOptional<'a> { pub enum DeleteCollectionNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDaemonSetResponse { Ok((DeleteCollectionNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDaemonSetOptional<'a> { pub enum DeleteNamespacedDaemonSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDaemonSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDaemonSetResponse { Ok((DeleteNamespacedDaemonSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDaemonSetForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDaemonSetForAllNamespacesResponse { }; Ok((ListDaemonSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl DaemonSet { #[derive(Debug)] pub enum ListNamespacedDaemonSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDaemonSetResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDaemonSetResponse { }; Ok((ListNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDaemonSetResponse { }; Ok((PatchNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDaemonSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDaemonSetStatusResponse { }; Ok((PatchNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDaemonSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDaemonSetResponse { }; Ok((ReadNamespacedDaemonSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDaemonSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDaemonSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDaemonSetStatusResponse { }; Ok((ReadNamespacedDaemonSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDaemonSetOptional<'a> { pub enum ReplaceNamespacedDaemonSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), Created(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetResponse { }; Ok((ReplaceNamespacedDaemonSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDaemonSetStatusOptional<'a> { pub enum ReplaceNamespacedDaemonSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::DaemonSet), Created(crate::v1_9::api::extensions::v1beta1::DaemonSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDaemonSetStatusResponse { }; Ok((ReplaceNamespacedDaemonSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDaemonSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDaemonSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDaemonSetStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchDaemonSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDaemonSetForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDaemonSetForAllNamespacesResponse { }; Ok((WatchDaemonSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDaemonSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDaemonSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDaemonSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl DaemonSet { #[derive(Debug)] pub enum WatchNamespacedDaemonSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDaemonSetResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDaemonSetResponse { }; Ok((WatchNamespacedDaemonSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDaemonSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDaemonSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDaemonSetResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/deployment.rs b/src/v1_9/api/extensions/v1beta1/deployment.rs index 45e20dd220..9562bcba84 100644 --- a/src/v1_9/api/extensions/v1beta1/deployment.rs +++ b/src/v1_9/api/extensions/v1beta1/deployment.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedDeploymentResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), Created(crate::v1_9::api::extensions::v1beta1::Deployment), Accepted(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedDeploymentResponse { }; Ok((CreateNamespacedDeploymentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedDeploymentOptional<'a> { pub enum DeleteCollectionNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedDeploymentResponse { Ok((DeleteCollectionNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedDeploymentOptional<'a> { pub enum DeleteNamespacedDeploymentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedDeploymentResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedDeploymentResponse { Ok((DeleteNamespacedDeploymentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Deployment { #[derive(Debug)] pub enum ListDeploymentForAllNamespacesResponse { Ok(crate::v1_9::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListDeploymentForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListDeploymentForAllNamespacesResponse { }; Ok((ListDeploymentForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Deployment { #[derive(Debug)] pub enum ListNamespacedDeploymentResponse { Ok(crate::v1_9::api::extensions::v1beta1::DeploymentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedDeploymentResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedDeploymentResponse { }; Ok((ListNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedDeploymentResponse { }; Ok((PatchNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedDeploymentStatusResponse { }; Ok((PatchNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedDeploymentOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedDeploymentResponse { }; Ok((ReadNamespacedDeploymentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedDeploymentStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedDeploymentStatusResponse { }; Ok((ReadNamespacedDeploymentStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedDeploymentOptional<'a> { pub enum ReplaceNamespacedDeploymentResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), Created(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedDeploymentResponse { }; Ok((ReplaceNamespacedDeploymentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedDeploymentStatusOptional<'a> { pub enum ReplaceNamespacedDeploymentStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Deployment), Created(crate::v1_9::api::extensions::v1beta1::Deployment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedDeploymentStatusResponse { }; Ok((ReplaceNamespacedDeploymentStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchDeploymentForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchDeploymentForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchDeploymentForAllNamespacesResponse { }; Ok((WatchDeploymentForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchDeploymentForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchDeploymentForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchDeploymentForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Deployment { #[derive(Debug)] pub enum WatchNamespacedDeploymentResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedDeploymentResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedDeploymentResponse { }; Ok((WatchNamespacedDeploymentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedDeploymentResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedDeploymentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedDeploymentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/deployment_rollback.rs b/src/v1_9/api/extensions/v1beta1/deployment_rollback.rs index b467fe1f89..7f77e1930a 100644 --- a/src/v1_9/api/extensions/v1beta1/deployment_rollback.rs +++ b/src/v1_9/api/extensions/v1beta1/deployment_rollback.rs @@ -75,8 +75,7 @@ pub enum CreateNamespacedDeploymentRollbackResponse { Ok(crate::v1_9::api::extensions::v1beta1::DeploymentRollback), Created(crate::v1_9::api::extensions::v1beta1::DeploymentRollback), Accepted(crate::v1_9::api::extensions::v1beta1::DeploymentRollback), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedDeploymentRollbackResponse { @@ -106,8 +105,20 @@ impl crate::Response for CreateNamespacedDeploymentRollbackResponse { }; Ok((CreateNamespacedDeploymentRollbackResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedDeploymentRollbackResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedDeploymentRollbackResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedDeploymentRollbackResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/ingress.rs b/src/v1_9/api/extensions/v1beta1/ingress.rs index c7ca73286b..3a085276ef 100644 --- a/src/v1_9/api/extensions/v1beta1/ingress.rs +++ b/src/v1_9/api/extensions/v1beta1/ingress.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedIngressResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), Created(crate::v1_9::api::extensions::v1beta1::Ingress), Accepted(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedIngressResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedIngressResponse { }; Ok((CreateNamespacedIngressResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedIngressOptional<'a> { pub enum DeleteCollectionNamespacedIngressResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedIngressResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedIngressResponse { Ok((DeleteCollectionNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedIngressOptional<'a> { pub enum DeleteNamespacedIngressResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedIngressResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedIngressResponse { Ok((DeleteNamespacedIngressResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl Ingress { #[derive(Debug)] pub enum ListIngressForAllNamespacesResponse { Ok(crate::v1_9::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListIngressForAllNamespacesResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListIngressForAllNamespacesResponse { }; Ok((ListIngressForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl Ingress { #[derive(Debug)] pub enum ListNamespacedIngressResponse { Ok(crate::v1_9::api::extensions::v1beta1::IngressList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedIngressResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListNamespacedIngressResponse { }; Ok((ListNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedIngressResponse { }; Ok((PatchNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedIngressStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedIngressStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedIngressStatusResponse { }; Ok((PatchNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedIngressOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedIngressResponse { }; Ok((ReadNamespacedIngressResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedIngressStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedIngressStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedIngressStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedIngressStatusResponse { }; Ok((ReadNamespacedIngressStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedIngressOptional<'a> { pub enum ReplaceNamespacedIngressResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), Created(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedIngressResponse { }; Ok((ReplaceNamespacedIngressResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedIngressStatusOptional<'a> { pub enum ReplaceNamespacedIngressStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::Ingress), Created(crate::v1_9::api::extensions::v1beta1::Ingress), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedIngressStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedIngressStatusResponse { }; Ok((ReplaceNamespacedIngressStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedIngressStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedIngressStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedIngressStatusResponse::Other(result), read)) + }, } } } @@ -1092,8 +1213,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchIngressForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchIngressForAllNamespacesResponse { @@ -1109,8 +1229,20 @@ impl crate::Response for WatchIngressForAllNamespacesResponse { }; Ok((WatchIngressForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchIngressForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchIngressForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchIngressForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl Ingress { #[derive(Debug)] pub enum WatchNamespacedIngressResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedIngressResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchNamespacedIngressResponse { }; Ok((WatchNamespacedIngressResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedIngressResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedIngressResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedIngressResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/network_policy.rs b/src/v1_9/api/extensions/v1beta1/network_policy.rs index b82e35a7ff..6c2cff2c68 100644 --- a/src/v1_9/api/extensions/v1beta1/network_policy.rs +++ b/src/v1_9/api/extensions/v1beta1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), Accepted(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), Created(crate::v1_9::api::extensions::v1beta1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/pod_security_policy.rs b/src/v1_9/api/extensions/v1beta1/pod_security_policy.rs index f4e4fe6620..3c66e17eb4 100644 --- a/src/v1_9/api/extensions/v1beta1/pod_security_policy.rs +++ b/src/v1_9/api/extensions/v1beta1/pod_security_policy.rs @@ -62,8 +62,7 @@ pub enum CreatePodSecurityPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), Accepted(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePodSecurityPolicyResponse { @@ -93,8 +92,20 @@ impl crate::Response for CreatePodSecurityPolicyResponse { }; Ok((CreatePodSecurityPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((CreatePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -195,8 +206,7 @@ pub struct DeleteCollectionPodSecurityPolicyOptional<'a> { pub enum DeleteCollectionPodSecurityPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { @@ -223,8 +233,20 @@ impl crate::Response for DeleteCollectionPodSecurityPolicyResponse { Ok((DeleteCollectionPodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -298,8 +320,7 @@ pub struct DeletePodSecurityPolicyOptional<'a> { pub enum DeletePodSecurityPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePodSecurityPolicyResponse { @@ -326,8 +347,20 @@ impl crate::Response for DeletePodSecurityPolicyResponse { Ok((DeletePodSecurityPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((DeletePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -400,8 +433,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum ListPodSecurityPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodSecurityPolicyResponse { @@ -415,8 +447,20 @@ impl crate::Response for ListPodSecurityPolicyResponse { }; Ok((ListPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ListPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -474,8 +518,7 @@ pub struct PatchPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum PatchPodSecurityPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPodSecurityPolicyResponse { @@ -489,8 +532,20 @@ impl crate::Response for PatchPodSecurityPolicyResponse { }; Ok((PatchPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -557,8 +612,7 @@ pub struct ReadPodSecurityPolicyOptional<'a> { #[derive(Debug)] pub enum ReadPodSecurityPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPodSecurityPolicyResponse { @@ -572,8 +626,20 @@ impl crate::Response for ReadPodSecurityPolicyResponse { }; Ok((ReadPodSecurityPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -632,8 +698,7 @@ pub struct ReplacePodSecurityPolicyOptional<'a> { pub enum ReplacePodSecurityPolicyResponse { Ok(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), Created(crate::v1_9::api::extensions::v1beta1::PodSecurityPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePodSecurityPolicyResponse { @@ -655,8 +720,20 @@ impl crate::Response for ReplacePodSecurityPolicyResponse { }; Ok((ReplacePodSecurityPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplacePodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePodSecurityPolicyResponse::Other(result), read)) + }, } } } @@ -722,8 +799,7 @@ impl PodSecurityPolicy { #[derive(Debug)] pub enum WatchPodSecurityPolicyResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodSecurityPolicyResponse { @@ -739,8 +815,20 @@ impl crate::Response for WatchPodSecurityPolicyResponse { }; Ok((WatchPodSecurityPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodSecurityPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchPodSecurityPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodSecurityPolicyResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/replica_set.rs b/src/v1_9/api/extensions/v1beta1/replica_set.rs index d00e965953..849edb468e 100644 --- a/src/v1_9/api/extensions/v1beta1/replica_set.rs +++ b/src/v1_9/api/extensions/v1beta1/replica_set.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedReplicaSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_9::api::extensions::v1beta1::ReplicaSet), Accepted(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedReplicaSetResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedReplicaSetResponse { }; Ok((CreateNamespacedReplicaSetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedReplicaSetOptional<'a> { pub enum DeleteCollectionNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedReplicaSetResponse { Ok((DeleteCollectionNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedReplicaSetOptional<'a> { pub enum DeleteNamespacedReplicaSetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedReplicaSetResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedReplicaSetResponse { Ok((DeleteNamespacedReplicaSetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListNamespacedReplicaSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedReplicaSetResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedReplicaSetResponse { }; Ok((ListNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum ListReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListReplicaSetForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListReplicaSetForAllNamespacesResponse { }; Ok((ListReplicaSetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedReplicaSetResponse { }; Ok((PatchNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -670,8 +736,7 @@ pub struct PatchNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetStatusResponse { @@ -685,8 +750,20 @@ impl crate::Response for PatchNamespacedReplicaSetStatusResponse { }; Ok((PatchNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -758,8 +835,7 @@ pub struct ReadNamespacedReplicaSetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetResponse { @@ -773,8 +849,20 @@ impl crate::Response for ReadNamespacedReplicaSetResponse { }; Ok((ReadNamespacedReplicaSetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -834,8 +922,7 @@ pub struct ReadNamespacedReplicaSetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetStatusResponse { @@ -849,8 +936,20 @@ impl crate::Response for ReadNamespacedReplicaSetStatusResponse { }; Ok((ReadNamespacedReplicaSetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -914,8 +1013,7 @@ pub struct ReplaceNamespacedReplicaSetOptional<'a> { pub enum ReplaceNamespacedReplicaSetResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetResponse { @@ -937,8 +1035,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetResponse { }; Ok((ReplaceNamespacedReplicaSetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1002,8 +1112,7 @@ pub struct ReplaceNamespacedReplicaSetStatusOptional<'a> { pub enum ReplaceNamespacedReplicaSetStatusResponse { Ok(crate::v1_9::api::extensions::v1beta1::ReplicaSet), Created(crate::v1_9::api::extensions::v1beta1::ReplicaSet), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { @@ -1025,8 +1134,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetStatusResponse { }; Ok((ReplaceNamespacedReplicaSetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetStatusResponse::Other(result), read)) + }, } } } @@ -1097,8 +1218,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchNamespacedReplicaSetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedReplicaSetResponse { @@ -1114,8 +1234,20 @@ impl crate::Response for WatchNamespacedReplicaSetResponse { }; Ok((WatchNamespacedReplicaSetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedReplicaSetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedReplicaSetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedReplicaSetResponse::Other(result), read)) + }, } } } @@ -1181,8 +1313,7 @@ impl ReplicaSet { #[derive(Debug)] pub enum WatchReplicaSetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchReplicaSetForAllNamespacesResponse { @@ -1198,8 +1329,20 @@ impl crate::Response for WatchReplicaSetForAllNamespacesResponse { }; Ok((WatchReplicaSetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchReplicaSetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchReplicaSetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchReplicaSetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/extensions/v1beta1/scale.rs b/src/v1_9/api/extensions/v1beta1/scale.rs index eeb113ce91..373b820aee 100644 --- a/src/v1_9/api/extensions/v1beta1/scale.rs +++ b/src/v1_9/api/extensions/v1beta1/scale.rs @@ -73,8 +73,7 @@ pub struct PatchNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedDeploymentScaleResponse { @@ -88,8 +87,20 @@ impl crate::Response for PatchNamespacedDeploymentScaleResponse { }; Ok((PatchNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -152,8 +163,7 @@ pub struct PatchNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicaSetScaleResponse { @@ -167,8 +177,20 @@ impl crate::Response for PatchNamespacedReplicaSetScaleResponse { }; Ok((PatchNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -231,8 +253,7 @@ pub struct PatchNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse { @@ -246,8 +267,20 @@ impl crate::Response for PatchNamespacedReplicationControllerDummyScaleResponse }; Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -307,8 +340,7 @@ pub struct ReadNamespacedDeploymentScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedDeploymentScaleResponse { @@ -322,8 +354,20 @@ impl crate::Response for ReadNamespacedDeploymentScaleResponse { }; Ok((ReadNamespacedDeploymentScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -383,8 +427,7 @@ pub struct ReadNamespacedReplicaSetScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicaSetScaleResponse { @@ -398,8 +441,20 @@ impl crate::Response for ReadNamespacedReplicaSetScaleResponse { }; Ok((ReadNamespacedReplicaSetScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -459,8 +514,7 @@ pub struct ReadNamespacedReplicationControllerDummyScaleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { @@ -474,8 +528,20 @@ impl crate::Response for ReadNamespacedReplicationControllerDummyScaleResponse { }; Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } @@ -539,8 +605,7 @@ pub struct ReplaceNamespacedDeploymentScaleOptional<'a> { pub enum ReplaceNamespacedDeploymentScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), Created(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { @@ -562,8 +627,20 @@ impl crate::Response for ReplaceNamespacedDeploymentScaleResponse { }; Ok((ReplaceNamespacedDeploymentScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedDeploymentScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedDeploymentScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedDeploymentScaleResponse::Other(result), read)) + }, } } } @@ -627,8 +704,7 @@ pub struct ReplaceNamespacedReplicaSetScaleOptional<'a> { pub enum ReplaceNamespacedReplicaSetScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), Created(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { @@ -650,8 +726,20 @@ impl crate::Response for ReplaceNamespacedReplicaSetScaleResponse { }; Ok((ReplaceNamespacedReplicaSetScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicaSetScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicaSetScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicaSetScaleResponse::Other(result), read)) + }, } } } @@ -715,8 +803,7 @@ pub struct ReplaceNamespacedReplicationControllerDummyScaleOptional<'a> { pub enum ReplaceNamespacedReplicationControllerDummyScaleResponse { Ok(crate::v1_9::api::extensions::v1beta1::Scale), Created(crate::v1_9::api::extensions::v1beta1::Scale), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleResponse { @@ -738,8 +825,20 @@ impl crate::Response for ReplaceNamespacedReplicationControllerDummyScaleRespons }; Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedReplicationControllerDummyScaleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/networking/v1/network_policy.rs b/src/v1_9/api/networking/v1/network_policy.rs index be5157434c..0351065dd8 100644 --- a/src/v1_9/api/networking/v1/network_policy.rs +++ b/src/v1_9/api/networking/v1/network_policy.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicy), Created(crate::v1_9::api::networking::v1::NetworkPolicy), Accepted(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedNetworkPolicyResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedNetworkPolicyResponse { }; Ok((CreateNamespacedNetworkPolicyResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedNetworkPolicyOptional<'a> { pub enum DeleteCollectionNamespacedNetworkPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedNetworkPolicyResponse { Ok((DeleteCollectionNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedNetworkPolicyOptional<'a> { pub enum DeleteNamespacedNetworkPolicyResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedNetworkPolicyResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedNetworkPolicyResponse { Ok((DeleteNamespacedNetworkPolicyResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedNetworkPolicyResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedNetworkPolicyResponse { }; Ok((ListNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum ListNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicyList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListNetworkPolicyForAllNamespacesResponse { }; Ok((ListNetworkPolicyForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedNetworkPolicyResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedNetworkPolicyResponse { }; Ok((PatchNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -676,8 +742,7 @@ pub struct ReadNamespacedNetworkPolicyOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedNetworkPolicyResponse { @@ -691,8 +756,20 @@ impl crate::Response for ReadNamespacedNetworkPolicyResponse { }; Ok((ReadNamespacedNetworkPolicyResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -756,8 +833,7 @@ pub struct ReplaceNamespacedNetworkPolicyOptional<'a> { pub enum ReplaceNamespacedNetworkPolicyResponse { Ok(crate::v1_9::api::networking::v1::NetworkPolicy), Created(crate::v1_9::api::networking::v1::NetworkPolicy), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { @@ -779,8 +855,20 @@ impl crate::Response for ReplaceNamespacedNetworkPolicyResponse { }; Ok((ReplaceNamespacedNetworkPolicyResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -851,8 +939,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNamespacedNetworkPolicyResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedNetworkPolicyResponse { @@ -868,8 +955,20 @@ impl crate::Response for WatchNamespacedNetworkPolicyResponse { }; Ok((WatchNamespacedNetworkPolicyResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedNetworkPolicyResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedNetworkPolicyResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedNetworkPolicyResponse::Other(result), read)) + }, } } } @@ -935,8 +1034,7 @@ impl NetworkPolicy { #[derive(Debug)] pub enum WatchNetworkPolicyForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { @@ -952,8 +1050,20 @@ impl crate::Response for WatchNetworkPolicyForAllNamespacesResponse { }; Ok((WatchNetworkPolicyForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNetworkPolicyForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchNetworkPolicyForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNetworkPolicyForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/policy/v1beta1/eviction.rs b/src/v1_9/api/policy/v1beta1/eviction.rs index 75ca5774b7..b324ad58b4 100644 --- a/src/v1_9/api/policy/v1beta1/eviction.rs +++ b/src/v1_9/api/policy/v1beta1/eviction.rs @@ -72,8 +72,7 @@ pub enum CreateNamespacedPodEvictionResponse { Ok(crate::v1_9::api::policy::v1beta1::Eviction), Created(crate::v1_9::api::policy::v1beta1::Eviction), Accepted(crate::v1_9::api::policy::v1beta1::Eviction), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodEvictionResponse { @@ -103,8 +102,20 @@ impl crate::Response for CreateNamespacedPodEvictionResponse { }; Ok((CreateNamespacedPodEvictionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodEvictionResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodEvictionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodEvictionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/policy/v1beta1/pod_disruption_budget.rs b/src/v1_9/api/policy/v1beta1/pod_disruption_budget.rs index 858ed4a492..d5cb322d41 100644 --- a/src/v1_9/api/policy/v1beta1/pod_disruption_budget.rs +++ b/src/v1_9/api/policy/v1beta1/pod_disruption_budget.rs @@ -69,8 +69,7 @@ pub enum CreateNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), Accepted(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { @@ -100,8 +99,20 @@ impl crate::Response for CreateNamespacedPodDisruptionBudgetResponse { }; Ok((CreateNamespacedPodDisruptionBudgetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -207,8 +218,7 @@ pub struct DeleteCollectionNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteCollectionNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { @@ -235,8 +245,20 @@ impl crate::Response for DeleteCollectionNamespacedPodDisruptionBudgetResponse { Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteNamespacedPodDisruptionBudgetOptional<'a> { pub enum DeleteNamespacedPodDisruptionBudgetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteNamespacedPodDisruptionBudgetResponse { Ok((DeleteNamespacedPodDisruptionBudgetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -422,8 +455,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { @@ -437,8 +469,20 @@ impl crate::Response for ListNamespacedPodDisruptionBudgetResponse { }; Ok((ListNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -511,8 +555,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum ListPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudgetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { @@ -526,8 +569,20 @@ impl crate::Response for ListPodDisruptionBudgetForAllNamespacesResponse { }; Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -590,8 +645,7 @@ pub struct PatchNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { @@ -605,8 +659,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetResponse { }; Ok((PatchNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -669,8 +735,7 @@ pub struct PatchNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { @@ -684,8 +749,20 @@ impl crate::Response for PatchNamespacedPodDisruptionBudgetStatusResponse { }; Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -757,8 +834,7 @@ pub struct ReadNamespacedPodDisruptionBudgetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { @@ -772,8 +848,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetResponse { }; Ok((ReadNamespacedPodDisruptionBudgetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -833,8 +921,7 @@ pub struct ReadNamespacedPodDisruptionBudgetStatusOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { @@ -848,8 +935,20 @@ impl crate::Response for ReadNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -913,8 +1012,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { @@ -936,8 +1034,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1001,8 +1111,7 @@ pub struct ReplaceNamespacedPodDisruptionBudgetStatusOptional<'a> { pub enum ReplaceNamespacedPodDisruptionBudgetStatusResponse { Ok(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), Created(crate::v1_9::api::policy::v1beta1::PodDisruptionBudget), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { @@ -1024,8 +1133,20 @@ impl crate::Response for ReplaceNamespacedPodDisruptionBudgetStatusResponse { }; Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodDisruptionBudgetStatusResponse::Other(result), read)) + }, } } } @@ -1096,8 +1217,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchNamespacedPodDisruptionBudgetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { @@ -1113,8 +1233,20 @@ impl crate::Response for WatchNamespacedPodDisruptionBudgetResponse { }; Ok((WatchNamespacedPodDisruptionBudgetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodDisruptionBudgetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodDisruptionBudgetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodDisruptionBudgetResponse::Other(result), read)) + }, } } } @@ -1180,8 +1312,7 @@ impl PodDisruptionBudget { #[derive(Debug)] pub enum WatchPodDisruptionBudgetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { @@ -1197,8 +1328,20 @@ impl crate::Response for WatchPodDisruptionBudgetForAllNamespacesResponse { }; Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodDisruptionBudgetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1/cluster_role.rs b/src/v1_9/api/rbac/v1/cluster_role.rs index c831d1be1d..88409ca3fa 100644 --- a/src/v1_9/api/rbac/v1/cluster_role.rs +++ b/src/v1_9/api/rbac/v1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRole), Created(crate::v1_9::api::rbac::v1::ClusterRole), Accepted(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRole), Created(crate::v1_9::api::rbac::v1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1/cluster_role_binding.rs b/src/v1_9/api/rbac/v1/cluster_role_binding.rs index aa449b8b56..46f1d2add5 100644 --- a/src/v1_9/api/rbac/v1/cluster_role_binding.rs +++ b/src/v1_9/api/rbac/v1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1::ClusterRoleBinding), Accepted(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1/role.rs b/src/v1_9/api/rbac/v1/role.rs index 20a3698a49..b189fa03fd 100644 --- a/src/v1_9/api/rbac/v1/role.rs +++ b/src/v1_9/api/rbac/v1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1::Role), Created(crate::v1_9::api::rbac::v1::Role), Accepted(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1::Role), Created(crate::v1_9::api::rbac::v1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1/role_binding.rs b/src/v1_9/api/rbac/v1/role_binding.rs index 6ee04c8137..5acef02bcf 100644 --- a/src/v1_9/api/rbac/v1/role_binding.rs +++ b/src/v1_9/api/rbac/v1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::RoleBinding), Created(crate::v1_9::api::rbac::v1::RoleBinding), Accepted(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1::RoleBinding), Created(crate::v1_9::api::rbac::v1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1alpha1/cluster_role.rs b/src/v1_9/api/rbac/v1alpha1/cluster_role.rs index 1e8f4c023f..f6de009010 100644 --- a/src/v1_9/api/rbac/v1alpha1/cluster_role.rs +++ b/src/v1_9/api/rbac/v1alpha1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_9::api::rbac::v1alpha1::ClusterRole), Accepted(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRole), Created(crate::v1_9::api::rbac::v1alpha1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1alpha1/cluster_role_binding.rs b/src/v1_9/api/rbac/v1alpha1/cluster_role_binding.rs index 3e39db86a2..df5eae9de6 100644 --- a/src/v1_9/api/rbac/v1alpha1/cluster_role_binding.rs +++ b/src/v1_9/api/rbac/v1alpha1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), Accepted(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1alpha1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1alpha1/role.rs b/src/v1_9/api/rbac/v1alpha1/role.rs index 3e8403feab..cecf9b47c2 100644 --- a/src/v1_9/api/rbac/v1alpha1/role.rs +++ b/src/v1_9/api/rbac/v1alpha1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::Role), Created(crate::v1_9::api::rbac::v1alpha1::Role), Accepted(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1alpha1::Role), Created(crate::v1_9::api::rbac::v1alpha1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1alpha1/role_binding.rs b/src/v1_9/api/rbac/v1alpha1/role_binding.rs index 5c12c708da..b33bb62f9d 100644 --- a/src/v1_9/api/rbac/v1alpha1/role_binding.rs +++ b/src/v1_9/api/rbac/v1alpha1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_9::api::rbac::v1alpha1::RoleBinding), Accepted(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1alpha1::RoleBinding), Created(crate::v1_9::api::rbac::v1alpha1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1beta1/cluster_role.rs b/src/v1_9/api/rbac/v1beta1/cluster_role.rs index 76f3f85853..3ec50fce2a 100644 --- a/src/v1_9/api/rbac/v1beta1/cluster_role.rs +++ b/src/v1_9/api/rbac/v1beta1/cluster_role.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRole), Created(crate::v1_9::api::rbac::v1beta1::ClusterRole), Accepted(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleResponse { }; Ok((CreateClusterRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleOptional<'a> { pub enum DeleteClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleResponse { Ok((DeleteClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleOptional<'a> { pub enum DeleteCollectionClusterRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleResponse { Ok((DeleteCollectionClusterRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRole { #[derive(Debug)] pub enum ListClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleResponse { }; Ok((ListClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleResponse { }; Ok((PatchClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleResponse { }; Ok((ReadClusterRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleOptional<'a> { pub enum ReplaceClusterRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRole), Created(crate::v1_9::api::rbac::v1beta1::ClusterRole), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleResponse { }; Ok((ReplaceClusterRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRole { #[derive(Debug)] pub enum WatchClusterRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleResponse { }; Ok((WatchClusterRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1beta1/cluster_role_binding.rs b/src/v1_9/api/rbac/v1beta1/cluster_role_binding.rs index a241db0c03..b5e2b6504a 100644 --- a/src/v1_9/api/rbac/v1beta1/cluster_role_binding.rs +++ b/src/v1_9/api/rbac/v1beta1/cluster_role_binding.rs @@ -65,8 +65,7 @@ pub enum CreateClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), Accepted(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateClusterRoleBindingResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateClusterRoleBindingResponse { }; Ok((CreateClusterRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -171,8 +182,7 @@ pub struct DeleteClusterRoleBindingOptional<'a> { pub enum DeleteClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteClusterRoleBindingResponse { @@ -199,8 +209,20 @@ impl crate::Response for DeleteClusterRoleBindingResponse { Ok((DeleteClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -301,8 +323,7 @@ pub struct DeleteCollectionClusterRoleBindingOptional<'a> { pub enum DeleteCollectionClusterRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionClusterRoleBindingResponse { @@ -329,8 +350,20 @@ impl crate::Response for DeleteCollectionClusterRoleBindingResponse { Ok((DeleteCollectionClusterRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -403,8 +436,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum ListClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListClusterRoleBindingResponse { @@ -418,8 +450,20 @@ impl crate::Response for ListClusterRoleBindingResponse { }; Ok((ListClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -477,8 +521,7 @@ pub struct PatchClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchClusterRoleBindingResponse { @@ -492,8 +535,20 @@ impl crate::Response for PatchClusterRoleBindingResponse { }; Ok((PatchClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -548,8 +603,7 @@ pub struct ReadClusterRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadClusterRoleBindingResponse { @@ -563,8 +617,20 @@ impl crate::Response for ReadClusterRoleBindingResponse { }; Ok((ReadClusterRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -623,8 +689,7 @@ pub struct ReplaceClusterRoleBindingOptional<'a> { pub enum ReplaceClusterRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), Created(crate::v1_9::api::rbac::v1beta1::ClusterRoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceClusterRoleBindingResponse { @@ -646,8 +711,20 @@ impl crate::Response for ReplaceClusterRoleBindingResponse { }; Ok((ReplaceClusterRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceClusterRoleBindingResponse::Other(result), read)) + }, } } } @@ -713,8 +790,7 @@ impl ClusterRoleBinding { #[derive(Debug)] pub enum WatchClusterRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchClusterRoleBindingResponse { @@ -730,8 +806,20 @@ impl crate::Response for WatchClusterRoleBindingResponse { }; Ok((WatchClusterRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchClusterRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchClusterRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchClusterRoleBindingResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1beta1/role.rs b/src/v1_9/api/rbac/v1beta1/role.rs index 5a0bab234d..7f535c1d5a 100644 --- a/src/v1_9/api/rbac/v1beta1/role.rs +++ b/src/v1_9/api/rbac/v1beta1/role.rs @@ -67,8 +67,7 @@ pub enum CreateNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::Role), Created(crate::v1_9::api::rbac::v1beta1::Role), Accepted(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateNamespacedRoleResponse { }; Ok((CreateNamespacedRoleResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -205,8 +216,7 @@ pub struct DeleteCollectionNamespacedRoleOptional<'a> { pub enum DeleteCollectionNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleResponse { @@ -233,8 +243,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleResponse { Ok((DeleteCollectionNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -313,8 +335,7 @@ pub struct DeleteNamespacedRoleOptional<'a> { pub enum DeleteNamespacedRoleResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleResponse { @@ -341,8 +362,20 @@ impl crate::Response for DeleteNamespacedRoleResponse { Ok((DeleteNamespacedRoleResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -420,8 +453,7 @@ impl Role { #[derive(Debug)] pub enum ListNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleResponse { @@ -435,8 +467,20 @@ impl crate::Response for ListNamespacedRoleResponse { }; Ok((ListNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -509,8 +553,7 @@ impl Role { #[derive(Debug)] pub enum ListRoleForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleForAllNamespacesResponse { @@ -524,8 +567,20 @@ impl crate::Response for ListRoleForAllNamespacesResponse { }; Ok((ListRoleForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -588,8 +643,7 @@ pub struct PatchNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleResponse { @@ -603,8 +657,20 @@ impl crate::Response for PatchNamespacedRoleResponse { }; Ok((PatchNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -664,8 +730,7 @@ pub struct ReadNamespacedRoleOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleResponse { @@ -679,8 +744,20 @@ impl crate::Response for ReadNamespacedRoleResponse { }; Ok((ReadNamespacedRoleResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -744,8 +821,7 @@ pub struct ReplaceNamespacedRoleOptional<'a> { pub enum ReplaceNamespacedRoleResponse { Ok(crate::v1_9::api::rbac::v1beta1::Role), Created(crate::v1_9::api::rbac::v1beta1::Role), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleResponse { @@ -767,8 +843,20 @@ impl crate::Response for ReplaceNamespacedRoleResponse { }; Ok((ReplaceNamespacedRoleResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -839,8 +927,7 @@ impl Role { #[derive(Debug)] pub enum WatchNamespacedRoleResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleResponse { @@ -856,8 +943,20 @@ impl crate::Response for WatchNamespacedRoleResponse { }; Ok((WatchNamespacedRoleResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleResponse::Other(result), read)) + }, } } } @@ -923,8 +1022,7 @@ impl Role { #[derive(Debug)] pub enum WatchRoleForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleForAllNamespacesResponse { @@ -940,8 +1038,20 @@ impl crate::Response for WatchRoleForAllNamespacesResponse { }; Ok((WatchRoleForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/rbac/v1beta1/role_binding.rs b/src/v1_9/api/rbac/v1beta1/role_binding.rs index d7e608856d..8035bfaf21 100644 --- a/src/v1_9/api/rbac/v1beta1/role_binding.rs +++ b/src/v1_9/api/rbac/v1beta1/role_binding.rs @@ -70,8 +70,7 @@ pub enum CreateNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBinding), Created(crate::v1_9::api::rbac::v1beta1::RoleBinding), Accepted(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedRoleBindingResponse { @@ -101,8 +100,20 @@ impl crate::Response for CreateNamespacedRoleBindingResponse { }; Ok((CreateNamespacedRoleBindingResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -208,8 +219,7 @@ pub struct DeleteCollectionNamespacedRoleBindingOptional<'a> { pub enum DeleteCollectionNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { @@ -236,8 +246,20 @@ impl crate::Response for DeleteCollectionNamespacedRoleBindingResponse { Ok((DeleteCollectionNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -316,8 +338,7 @@ pub struct DeleteNamespacedRoleBindingOptional<'a> { pub enum DeleteNamespacedRoleBindingResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedRoleBindingResponse { @@ -344,8 +365,20 @@ impl crate::Response for DeleteNamespacedRoleBindingResponse { Ok((DeleteNamespacedRoleBindingResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -423,8 +456,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedRoleBindingResponse { @@ -438,8 +470,20 @@ impl crate::Response for ListNamespacedRoleBindingResponse { }; Ok((ListNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -512,8 +556,7 @@ impl RoleBinding { #[derive(Debug)] pub enum ListRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBindingList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListRoleBindingForAllNamespacesResponse { @@ -527,8 +570,20 @@ impl crate::Response for ListRoleBindingForAllNamespacesResponse { }; Ok((ListRoleBindingForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -591,8 +646,7 @@ pub struct PatchNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedRoleBindingResponse { @@ -606,8 +660,20 @@ impl crate::Response for PatchNamespacedRoleBindingResponse { }; Ok((PatchNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -667,8 +733,7 @@ pub struct ReadNamespacedRoleBindingOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedRoleBindingResponse { @@ -682,8 +747,20 @@ impl crate::Response for ReadNamespacedRoleBindingResponse { }; Ok((ReadNamespacedRoleBindingResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -747,8 +824,7 @@ pub struct ReplaceNamespacedRoleBindingOptional<'a> { pub enum ReplaceNamespacedRoleBindingResponse { Ok(crate::v1_9::api::rbac::v1beta1::RoleBinding), Created(crate::v1_9::api::rbac::v1beta1::RoleBinding), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedRoleBindingResponse { @@ -770,8 +846,20 @@ impl crate::Response for ReplaceNamespacedRoleBindingResponse { }; Ok((ReplaceNamespacedRoleBindingResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -842,8 +930,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchNamespacedRoleBindingResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedRoleBindingResponse { @@ -859,8 +946,20 @@ impl crate::Response for WatchNamespacedRoleBindingResponse { }; Ok((WatchNamespacedRoleBindingResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedRoleBindingResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedRoleBindingResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedRoleBindingResponse::Other(result), read)) + }, } } } @@ -926,8 +1025,7 @@ impl RoleBinding { #[derive(Debug)] pub enum WatchRoleBindingForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchRoleBindingForAllNamespacesResponse { @@ -943,8 +1041,20 @@ impl crate::Response for WatchRoleBindingForAllNamespacesResponse { }; Ok((WatchRoleBindingForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchRoleBindingForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchRoleBindingForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchRoleBindingForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/scheduling/v1alpha1/priority_class.rs b/src/v1_9/api/scheduling/v1alpha1/priority_class.rs index 5d34f3669e..2e5ec0503b 100644 --- a/src/v1_9/api/scheduling/v1alpha1/priority_class.rs +++ b/src/v1_9/api/scheduling/v1alpha1/priority_class.rs @@ -68,8 +68,7 @@ pub enum CreatePriorityClassResponse { Ok(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), Accepted(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreatePriorityClassResponse { @@ -99,8 +98,20 @@ impl crate::Response for CreatePriorityClassResponse { }; Ok((CreatePriorityClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreatePriorityClassResponse::Unauthorized, 0)), - _ => Ok((CreatePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreatePriorityClassResponse::Other(result), read)) + }, } } } @@ -201,8 +212,7 @@ pub struct DeleteCollectionPriorityClassOptional<'a> { pub enum DeleteCollectionPriorityClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionPriorityClassResponse { @@ -229,8 +239,20 @@ impl crate::Response for DeleteCollectionPriorityClassResponse { Ok((DeleteCollectionPriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionPriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionPriorityClassResponse::Other(result), read)) + }, } } } @@ -304,8 +326,7 @@ pub struct DeletePriorityClassOptional<'a> { pub enum DeletePriorityClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeletePriorityClassResponse { @@ -332,8 +353,20 @@ impl crate::Response for DeletePriorityClassResponse { Ok((DeletePriorityClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeletePriorityClassResponse::Unauthorized, 0)), - _ => Ok((DeletePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeletePriorityClassResponse::Other(result), read)) + }, } } } @@ -406,8 +439,7 @@ impl PriorityClass { #[derive(Debug)] pub enum ListPriorityClassResponse { Ok(crate::v1_9::api::scheduling::v1alpha1::PriorityClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPriorityClassResponse { @@ -421,8 +453,20 @@ impl crate::Response for ListPriorityClassResponse { }; Ok((ListPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ListPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPriorityClassResponse::Other(result), read)) + }, } } } @@ -480,8 +524,7 @@ pub struct PatchPriorityClassOptional<'a> { #[derive(Debug)] pub enum PatchPriorityClassResponse { Ok(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchPriorityClassResponse { @@ -495,8 +538,20 @@ impl crate::Response for PatchPriorityClassResponse { }; Ok((PatchPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((PatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchPriorityClassResponse::Other(result), read)) + }, } } } @@ -563,8 +618,7 @@ pub struct ReadPriorityClassOptional<'a> { #[derive(Debug)] pub enum ReadPriorityClassResponse { Ok(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadPriorityClassResponse { @@ -578,8 +632,20 @@ impl crate::Response for ReadPriorityClassResponse { }; Ok((ReadPriorityClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadPriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReadPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadPriorityClassResponse::Other(result), read)) + }, } } } @@ -638,8 +704,7 @@ pub struct ReplacePriorityClassOptional<'a> { pub enum ReplacePriorityClassResponse { Ok(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), Created(crate::v1_9::api::scheduling::v1alpha1::PriorityClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplacePriorityClassResponse { @@ -661,8 +726,20 @@ impl crate::Response for ReplacePriorityClassResponse { }; Ok((ReplacePriorityClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplacePriorityClassResponse::Unauthorized, 0)), - _ => Ok((ReplacePriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplacePriorityClassResponse::Other(result), read)) + }, } } } @@ -728,8 +805,7 @@ impl PriorityClass { #[derive(Debug)] pub enum WatchPriorityClassResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPriorityClassResponse { @@ -745,8 +821,20 @@ impl crate::Response for WatchPriorityClassResponse { }; Ok((WatchPriorityClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPriorityClassResponse::Unauthorized, 0)), - _ => Ok((WatchPriorityClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPriorityClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/settings/v1alpha1/pod_preset.rs b/src/v1_9/api/settings/v1alpha1/pod_preset.rs index 825939f8ab..a9e97c97d4 100644 --- a/src/v1_9/api/settings/v1alpha1/pod_preset.rs +++ b/src/v1_9/api/settings/v1alpha1/pod_preset.rs @@ -65,8 +65,7 @@ pub enum CreateNamespacedPodPresetResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPreset), Created(crate::v1_9::api::settings::v1alpha1::PodPreset), Accepted(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateNamespacedPodPresetResponse { @@ -96,8 +95,20 @@ impl crate::Response for CreateNamespacedPodPresetResponse { }; Ok((CreateNamespacedPodPresetResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((CreateNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -203,8 +214,7 @@ pub struct DeleteCollectionNamespacedPodPresetOptional<'a> { pub enum DeleteCollectionNamespacedPodPresetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { @@ -231,8 +241,20 @@ impl crate::Response for DeleteCollectionNamespacedPodPresetResponse { Ok((DeleteCollectionNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -311,8 +333,7 @@ pub struct DeleteNamespacedPodPresetOptional<'a> { pub enum DeleteNamespacedPodPresetResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteNamespacedPodPresetResponse { @@ -339,8 +360,20 @@ impl crate::Response for DeleteNamespacedPodPresetResponse { Ok((DeleteNamespacedPodPresetResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((DeleteNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -418,8 +451,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListNamespacedPodPresetResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListNamespacedPodPresetResponse { @@ -433,8 +465,20 @@ impl crate::Response for ListNamespacedPodPresetResponse { }; Ok((ListNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ListNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -507,8 +551,7 @@ impl PodPreset { #[derive(Debug)] pub enum ListPodPresetForAllNamespacesResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPresetList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListPodPresetForAllNamespacesResponse { @@ -522,8 +565,20 @@ impl crate::Response for ListPodPresetForAllNamespacesResponse { }; Ok((ListPodPresetForAllNamespacesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((ListPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } @@ -586,8 +641,7 @@ pub struct PatchNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum PatchNamespacedPodPresetResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchNamespacedPodPresetResponse { @@ -601,8 +655,20 @@ impl crate::Response for PatchNamespacedPodPresetResponse { }; Ok((PatchNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((PatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -674,8 +740,7 @@ pub struct ReadNamespacedPodPresetOptional<'a> { #[derive(Debug)] pub enum ReadNamespacedPodPresetResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadNamespacedPodPresetResponse { @@ -689,8 +754,20 @@ impl crate::Response for ReadNamespacedPodPresetResponse { }; Ok((ReadNamespacedPodPresetResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReadNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -754,8 +831,7 @@ pub struct ReplaceNamespacedPodPresetOptional<'a> { pub enum ReplaceNamespacedPodPresetResponse { Ok(crate::v1_9::api::settings::v1alpha1::PodPreset), Created(crate::v1_9::api::settings::v1alpha1::PodPreset), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceNamespacedPodPresetResponse { @@ -777,8 +853,20 @@ impl crate::Response for ReplaceNamespacedPodPresetResponse { }; Ok((ReplaceNamespacedPodPresetResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((ReplaceNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -849,8 +937,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchNamespacedPodPresetResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchNamespacedPodPresetResponse { @@ -866,8 +953,20 @@ impl crate::Response for WatchNamespacedPodPresetResponse { }; Ok((WatchNamespacedPodPresetResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchNamespacedPodPresetResponse::Unauthorized, 0)), - _ => Ok((WatchNamespacedPodPresetResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchNamespacedPodPresetResponse::Other(result), read)) + }, } } } @@ -933,8 +1032,7 @@ impl PodPreset { #[derive(Debug)] pub enum WatchPodPresetForAllNamespacesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchPodPresetForAllNamespacesResponse { @@ -950,8 +1048,20 @@ impl crate::Response for WatchPodPresetForAllNamespacesResponse { }; Ok((WatchPodPresetForAllNamespacesResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchPodPresetForAllNamespacesResponse::Unauthorized, 0)), - _ => Ok((WatchPodPresetForAllNamespacesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchPodPresetForAllNamespacesResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/storage/v1/storage_class.rs b/src/v1_9/api/storage/v1/storage_class.rs index 405a51ee20..24cf881f9e 100644 --- a/src/v1_9/api/storage/v1/storage_class.rs +++ b/src/v1_9/api/storage/v1/storage_class.rs @@ -79,8 +79,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_9::api::storage::v1::StorageClass), Created(crate::v1_9::api::storage::v1::StorageClass), Accepted(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -417,8 +450,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_9::api::storage::v1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -432,8 +464,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -506,8 +549,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -574,8 +629,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -589,8 +643,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_9::api::storage::v1::StorageClass), Created(crate::v1_9::api::storage::v1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -672,8 +737,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -739,8 +816,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -756,8 +832,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/storage/v1alpha1/volume_attachment.rs b/src/v1_9/api/storage/v1alpha1/volume_attachment.rs index 903b4f95b0..d4c3f9c2e4 100644 --- a/src/v1_9/api/storage/v1alpha1/volume_attachment.rs +++ b/src/v1_9/api/storage/v1alpha1/volume_attachment.rs @@ -67,8 +67,7 @@ pub enum CreateVolumeAttachmentResponse { Ok(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), Accepted(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateVolumeAttachmentResponse { @@ -98,8 +97,20 @@ impl crate::Response for CreateVolumeAttachmentResponse { }; Ok((CreateVolumeAttachmentResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((CreateVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -200,8 +211,7 @@ pub struct DeleteCollectionVolumeAttachmentOptional<'a> { pub enum DeleteCollectionVolumeAttachmentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionVolumeAttachmentResponse { @@ -228,8 +238,20 @@ impl crate::Response for DeleteCollectionVolumeAttachmentResponse { Ok((DeleteCollectionVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -303,8 +325,7 @@ pub struct DeleteVolumeAttachmentOptional<'a> { pub enum DeleteVolumeAttachmentResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteVolumeAttachmentResponse { @@ -331,8 +352,20 @@ impl crate::Response for DeleteVolumeAttachmentResponse { Ok((DeleteVolumeAttachmentResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((DeleteVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -405,8 +438,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum ListVolumeAttachmentResponse { Ok(crate::v1_9::api::storage::v1alpha1::VolumeAttachmentList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListVolumeAttachmentResponse { @@ -420,8 +452,20 @@ impl crate::Response for ListVolumeAttachmentResponse { }; Ok((ListVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ListVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -479,8 +523,7 @@ pub struct PatchVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum PatchVolumeAttachmentResponse { Ok(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchVolumeAttachmentResponse { @@ -494,8 +537,20 @@ impl crate::Response for PatchVolumeAttachmentResponse { }; Ok((PatchVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((PatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -562,8 +617,7 @@ pub struct ReadVolumeAttachmentOptional<'a> { #[derive(Debug)] pub enum ReadVolumeAttachmentResponse { Ok(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadVolumeAttachmentResponse { @@ -577,8 +631,20 @@ impl crate::Response for ReadVolumeAttachmentResponse { }; Ok((ReadVolumeAttachmentResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReadVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -637,8 +703,7 @@ pub struct ReplaceVolumeAttachmentOptional<'a> { pub enum ReplaceVolumeAttachmentResponse { Ok(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), Created(crate::v1_9::api::storage::v1alpha1::VolumeAttachment), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceVolumeAttachmentResponse { @@ -660,8 +725,20 @@ impl crate::Response for ReplaceVolumeAttachmentResponse { }; Ok((ReplaceVolumeAttachmentResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((ReplaceVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceVolumeAttachmentResponse::Other(result), read)) + }, } } } @@ -727,8 +804,7 @@ impl VolumeAttachment { #[derive(Debug)] pub enum WatchVolumeAttachmentResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchVolumeAttachmentResponse { @@ -744,8 +820,20 @@ impl crate::Response for WatchVolumeAttachmentResponse { }; Ok((WatchVolumeAttachmentResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchVolumeAttachmentResponse::Unauthorized, 0)), - _ => Ok((WatchVolumeAttachmentResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchVolumeAttachmentResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/api/storage/v1beta1/storage_class.rs b/src/v1_9/api/storage/v1beta1/storage_class.rs index 261fa8acc6..4ef1c4462f 100644 --- a/src/v1_9/api/storage/v1beta1/storage_class.rs +++ b/src/v1_9/api/storage/v1beta1/storage_class.rs @@ -79,8 +79,7 @@ pub enum CreateStorageClassResponse { Ok(crate::v1_9::api::storage::v1beta1::StorageClass), Created(crate::v1_9::api::storage::v1beta1::StorageClass), Accepted(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateStorageClassResponse { @@ -110,8 +109,20 @@ impl crate::Response for CreateStorageClassResponse { }; Ok((CreateStorageClassResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateStorageClassResponse::Unauthorized, 0)), - _ => Ok((CreateStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateStorageClassResponse::Other(result), read)) + }, } } } @@ -212,8 +223,7 @@ pub struct DeleteCollectionStorageClassOptional<'a> { pub enum DeleteCollectionStorageClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionStorageClassResponse { @@ -240,8 +250,20 @@ impl crate::Response for DeleteCollectionStorageClassResponse { Ok((DeleteCollectionStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionStorageClassResponse::Other(result), read)) + }, } } } @@ -315,8 +337,7 @@ pub struct DeleteStorageClassOptional<'a> { pub enum DeleteStorageClassResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteStorageClassResponse { @@ -343,8 +364,20 @@ impl crate::Response for DeleteStorageClassResponse { Ok((DeleteStorageClassResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteStorageClassResponse::Unauthorized, 0)), - _ => Ok((DeleteStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteStorageClassResponse::Other(result), read)) + }, } } } @@ -417,8 +450,7 @@ impl StorageClass { #[derive(Debug)] pub enum ListStorageClassResponse { Ok(crate::v1_9::api::storage::v1beta1::StorageClassList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListStorageClassResponse { @@ -432,8 +464,20 @@ impl crate::Response for ListStorageClassResponse { }; Ok((ListStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListStorageClassResponse::Unauthorized, 0)), - _ => Ok((ListStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListStorageClassResponse::Other(result), read)) + }, } } } @@ -491,8 +535,7 @@ pub struct PatchStorageClassOptional<'a> { #[derive(Debug)] pub enum PatchStorageClassResponse { Ok(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchStorageClassResponse { @@ -506,8 +549,20 @@ impl crate::Response for PatchStorageClassResponse { }; Ok((PatchStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((PatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchStorageClassResponse::Other(result), read)) + }, } } } @@ -574,8 +629,7 @@ pub struct ReadStorageClassOptional<'a> { #[derive(Debug)] pub enum ReadStorageClassResponse { Ok(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadStorageClassResponse { @@ -589,8 +643,20 @@ impl crate::Response for ReadStorageClassResponse { }; Ok((ReadStorageClassResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReadStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadStorageClassResponse::Other(result), read)) + }, } } } @@ -649,8 +715,7 @@ pub struct ReplaceStorageClassOptional<'a> { pub enum ReplaceStorageClassResponse { Ok(crate::v1_9::api::storage::v1beta1::StorageClass), Created(crate::v1_9::api::storage::v1beta1::StorageClass), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceStorageClassResponse { @@ -672,8 +737,20 @@ impl crate::Response for ReplaceStorageClassResponse { }; Ok((ReplaceStorageClassResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceStorageClassResponse::Unauthorized, 0)), - _ => Ok((ReplaceStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceStorageClassResponse::Other(result), read)) + }, } } } @@ -739,8 +816,7 @@ impl StorageClass { #[derive(Debug)] pub enum WatchStorageClassResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchStorageClassResponse { @@ -756,8 +832,20 @@ impl crate::Response for WatchStorageClassResponse { }; Ok((WatchStorageClassResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchStorageClassResponse::Unauthorized, 0)), - _ => Ok((WatchStorageClassResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchStorageClassResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs b/src/v1_9/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs index a72fe06119..2d97a2463a 100644 --- a/src/v1_9/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs +++ b/src/v1_9/apiextensions_apiserver/pkg/apis/apiextensions/v1beta1/custom_resource_definition.rs @@ -64,8 +64,7 @@ pub enum CreateCustomResourceDefinitionResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Accepted(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateCustomResourceDefinitionResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateCustomResourceDefinitionResponse { }; Ok((CreateCustomResourceDefinitionResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((CreateCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -197,8 +208,7 @@ pub struct DeleteCollectionCustomResourceDefinitionOptional<'a> { pub enum DeleteCollectionCustomResourceDefinitionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { @@ -225,8 +235,20 @@ impl crate::Response for DeleteCollectionCustomResourceDefinitionResponse { Ok((DeleteCollectionCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCustomResourceDefinitionOptional<'a> { pub enum DeleteCustomResourceDefinitionResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCustomResourceDefinitionResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCustomResourceDefinitionResponse { Ok((DeleteCustomResourceDefinitionResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((DeleteCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum ListCustomResourceDefinitionResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinitionList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListCustomResourceDefinitionResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListCustomResourceDefinitionResponse { }; Ok((ListCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ListCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum PatchCustomResourceDefinitionResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchCustomResourceDefinitionResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchCustomResourceDefinitionResponse { }; Ok((PatchCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((PatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadCustomResourceDefinitionOptional<'a> { #[derive(Debug)] pub enum ReadCustomResourceDefinitionResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadCustomResourceDefinitionResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadCustomResourceDefinitionResponse { }; Ok((ReadCustomResourceDefinitionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReadCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceCustomResourceDefinitionOptional<'a> { pub enum ReplaceCustomResourceDefinitionResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionResponse { }; Ok((ReplaceCustomResourceDefinitionResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceCustomResourceDefinitionStatusOptional<'a> { pub enum ReplaceCustomResourceDefinitionStatusResponse { Ok(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), Created(crate::v1_9::apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceDefinition), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceCustomResourceDefinitionStatusResponse { }; Ok((ReplaceCustomResourceDefinitionStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceCustomResourceDefinitionStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceCustomResourceDefinitionStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceCustomResourceDefinitionStatusResponse::Other(result), read)) + }, } } } @@ -807,8 +895,7 @@ impl CustomResourceDefinition { #[derive(Debug)] pub enum WatchCustomResourceDefinitionResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchCustomResourceDefinitionResponse { @@ -824,8 +911,20 @@ impl crate::Response for WatchCustomResourceDefinitionResponse { }; Ok((WatchCustomResourceDefinitionResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchCustomResourceDefinitionResponse::Unauthorized, 0)), - _ => Ok((WatchCustomResourceDefinitionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchCustomResourceDefinitionResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs b/src/v1_9/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs index a49a5eb870..a4b17e79e6 100644 --- a/src/v1_9/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs +++ b/src/v1_9/kube_aggregator/pkg/apis/apiregistration/v1beta1/api_service.rs @@ -64,8 +64,7 @@ pub enum CreateAPIServiceResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Accepted(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for CreateAPIServiceResponse { @@ -95,8 +94,20 @@ impl crate::Response for CreateAPIServiceResponse { }; Ok((CreateAPIServiceResponse::Accepted(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((CreateAPIServiceResponse::Unauthorized, 0)), - _ => Ok((CreateAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((CreateAPIServiceResponse::Other(result), read)) + }, } } } @@ -170,8 +181,7 @@ pub struct DeleteAPIServiceOptional<'a> { pub enum DeleteAPIServiceResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteAPIServiceResponse { @@ -198,8 +208,20 @@ impl crate::Response for DeleteAPIServiceResponse { Ok((DeleteAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteAPIServiceResponse::Other(result), read)) + }, } } } @@ -300,8 +322,7 @@ pub struct DeleteCollectionAPIServiceOptional<'a> { pub enum DeleteCollectionAPIServiceResponse { OkStatus(crate::v1_9::apimachinery::pkg::apis::meta::v1::Status), OkValue(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for DeleteCollectionAPIServiceResponse { @@ -328,8 +349,20 @@ impl crate::Response for DeleteCollectionAPIServiceResponse { Ok((DeleteCollectionAPIServiceResponse::OkValue(result), buf.len())) } }, - http::StatusCode::UNAUTHORIZED => Ok((DeleteCollectionAPIServiceResponse::Unauthorized, 0)), - _ => Ok((DeleteCollectionAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((DeleteCollectionAPIServiceResponse::Other(result), read)) + }, } } } @@ -402,8 +435,7 @@ impl APIService { #[derive(Debug)] pub enum ListAPIServiceResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIServiceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ListAPIServiceResponse { @@ -417,8 +449,20 @@ impl crate::Response for ListAPIServiceResponse { }; Ok((ListAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ListAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ListAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ListAPIServiceResponse::Other(result), read)) + }, } } } @@ -476,8 +520,7 @@ pub struct PatchAPIServiceOptional<'a> { #[derive(Debug)] pub enum PatchAPIServiceResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for PatchAPIServiceResponse { @@ -491,8 +534,20 @@ impl crate::Response for PatchAPIServiceResponse { }; Ok((PatchAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((PatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((PatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((PatchAPIServiceResponse::Other(result), read)) + }, } } } @@ -559,8 +614,7 @@ pub struct ReadAPIServiceOptional<'a> { #[derive(Debug)] pub enum ReadAPIServiceResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReadAPIServiceResponse { @@ -574,8 +628,20 @@ impl crate::Response for ReadAPIServiceResponse { }; Ok((ReadAPIServiceResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReadAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReadAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReadAPIServiceResponse::Other(result), read)) + }, } } } @@ -634,8 +700,7 @@ pub struct ReplaceAPIServiceOptional<'a> { pub enum ReplaceAPIServiceResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceResponse { @@ -657,8 +722,20 @@ impl crate::Response for ReplaceAPIServiceResponse { }; Ok((ReplaceAPIServiceResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceResponse::Other(result), read)) + }, } } } @@ -717,8 +794,7 @@ pub struct ReplaceAPIServiceStatusOptional<'a> { pub enum ReplaceAPIServiceStatusResponse { Ok(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), Created(crate::v1_9::kube_aggregator::pkg::apis::apiregistration::v1beta1::APIService), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for ReplaceAPIServiceStatusResponse { @@ -740,8 +816,20 @@ impl crate::Response for ReplaceAPIServiceStatusResponse { }; Ok((ReplaceAPIServiceStatusResponse::Created(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((ReplaceAPIServiceStatusResponse::Unauthorized, 0)), - _ => Ok((ReplaceAPIServiceStatusResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((ReplaceAPIServiceStatusResponse::Other(result), read)) + }, } } } @@ -807,8 +895,7 @@ impl APIService { #[derive(Debug)] pub enum WatchAPIServiceResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::WatchEvent), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for WatchAPIServiceResponse { @@ -824,8 +911,20 @@ impl crate::Response for WatchAPIServiceResponse { }; Ok((WatchAPIServiceResponse::Ok(result), byte_offset)) }, - http::StatusCode::UNAUTHORIZED => Ok((WatchAPIServiceResponse::Unauthorized, 0)), - _ => Ok((WatchAPIServiceResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((WatchAPIServiceResponse::Other(result), read)) + }, } } } diff --git a/src/v1_9/mod.rs b/src/v1_9/mod.rs index 010441d76e..db3cb5a18f 100644 --- a/src/v1_9/mod.rs +++ b/src/v1_9/mod.rs @@ -38,8 +38,7 @@ pub fn get_api_versions( #[derive(Debug)] pub enum GetAPIVersionsResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroupList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAPIVersionsResponse { @@ -53,8 +52,20 @@ impl crate::Response for GetAPIVersionsResponse { }; Ok((GetAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAPIVersionsResponse::Other(result), read)) + }, } } } @@ -80,8 +91,7 @@ pub fn get_admissionregistration_api_group( #[derive(Debug)] pub enum GetAdmissionregistrationAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationAPIGroupResponse { @@ -95,8 +105,20 @@ impl crate::Response for GetAdmissionregistrationAPIGroupResponse { }; Ok((GetAdmissionregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -122,8 +144,7 @@ pub fn get_admissionregistration_v1alpha1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { @@ -137,8 +158,20 @@ impl crate::Response for GetAdmissionregistrationV1alpha1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -164,8 +197,7 @@ pub fn get_admissionregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetAdmissionregistrationV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { @@ -179,8 +211,20 @@ impl crate::Response for GetAdmissionregistrationV1beta1APIResourcesResponse { }; Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAdmissionregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -206,8 +250,7 @@ pub fn get_apiextensions_api_group( #[derive(Debug)] pub enum GetApiextensionsAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsAPIGroupResponse { @@ -221,8 +264,20 @@ impl crate::Response for GetApiextensionsAPIGroupResponse { }; Ok((GetApiextensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -248,8 +303,7 @@ pub fn get_apiextensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiextensionsV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { @@ -263,8 +317,20 @@ impl crate::Response for GetApiextensionsV1beta1APIResourcesResponse { }; Ok((GetApiextensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiextensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiextensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiextensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -290,8 +356,7 @@ pub fn get_apiregistration_api_group( #[derive(Debug)] pub enum GetApiregistrationAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationAPIGroupResponse { @@ -305,8 +370,20 @@ impl crate::Response for GetApiregistrationAPIGroupResponse { }; Ok((GetApiregistrationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationAPIGroupResponse::Other(result), read)) + }, } } } @@ -332,8 +409,7 @@ pub fn get_apiregistration_v1beta1_api_resources( #[derive(Debug)] pub enum GetApiregistrationV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { @@ -347,8 +423,20 @@ impl crate::Response for GetApiregistrationV1beta1APIResourcesResponse { }; Ok((GetApiregistrationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetApiregistrationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetApiregistrationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetApiregistrationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -374,8 +462,7 @@ pub fn get_apps_api_group( #[derive(Debug)] pub enum GetAppsAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsAPIGroupResponse { @@ -389,8 +476,20 @@ impl crate::Response for GetAppsAPIGroupResponse { }; Ok((GetAppsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAppsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsAPIGroupResponse::Other(result), read)) + }, } } } @@ -416,8 +515,7 @@ pub fn get_apps_v1_api_resources( #[derive(Debug)] pub enum GetAppsV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1APIResourcesResponse { @@ -431,8 +529,20 @@ impl crate::Response for GetAppsV1APIResourcesResponse { }; Ok((GetAppsV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -458,8 +568,7 @@ pub fn get_apps_v1beta1_api_resources( #[derive(Debug)] pub enum GetAppsV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta1APIResourcesResponse { @@ -473,8 +582,20 @@ impl crate::Response for GetAppsV1beta1APIResourcesResponse { }; Ok((GetAppsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -500,8 +621,7 @@ pub fn get_apps_v1beta2_api_resources( #[derive(Debug)] pub enum GetAppsV1beta2APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAppsV1beta2APIResourcesResponse { @@ -515,8 +635,20 @@ impl crate::Response for GetAppsV1beta2APIResourcesResponse { }; Ok((GetAppsV1beta2APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAppsV1beta2APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAppsV1beta2APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAppsV1beta2APIResourcesResponse::Other(result), read)) + }, } } } @@ -542,8 +674,7 @@ pub fn get_authentication_api_group( #[derive(Debug)] pub enum GetAuthenticationAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationAPIGroupResponse { @@ -557,8 +688,20 @@ impl crate::Response for GetAuthenticationAPIGroupResponse { }; Ok((GetAuthenticationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationAPIGroupResponse::Other(result), read)) + }, } } } @@ -584,8 +727,7 @@ pub fn get_authentication_v1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1APIResourcesResponse { @@ -599,8 +741,20 @@ impl crate::Response for GetAuthenticationV1APIResourcesResponse { }; Ok((GetAuthenticationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -626,8 +780,7 @@ pub fn get_authentication_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthenticationV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { @@ -641,8 +794,20 @@ impl crate::Response for GetAuthenticationV1beta1APIResourcesResponse { }; Ok((GetAuthenticationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthenticationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthenticationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthenticationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -668,8 +833,7 @@ pub fn get_authorization_api_group( #[derive(Debug)] pub enum GetAuthorizationAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationAPIGroupResponse { @@ -683,8 +847,20 @@ impl crate::Response for GetAuthorizationAPIGroupResponse { }; Ok((GetAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -710,8 +886,7 @@ pub fn get_authorization_v1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1APIResourcesResponse { @@ -725,8 +900,20 @@ impl crate::Response for GetAuthorizationV1APIResourcesResponse { }; Ok((GetAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -752,8 +939,7 @@ pub fn get_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { @@ -767,8 +953,20 @@ impl crate::Response for GetAuthorizationV1beta1APIResourcesResponse { }; Ok((GetAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -794,8 +992,7 @@ pub fn get_autoscaling_api_group( #[derive(Debug)] pub enum GetAutoscalingAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingAPIGroupResponse { @@ -809,8 +1006,20 @@ impl crate::Response for GetAutoscalingAPIGroupResponse { }; Ok((GetAutoscalingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingAPIGroupResponse::Other(result), read)) + }, } } } @@ -836,8 +1045,7 @@ pub fn get_autoscaling_v1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV1APIResourcesResponse { @@ -851,8 +1059,20 @@ impl crate::Response for GetAutoscalingV1APIResourcesResponse { }; Ok((GetAutoscalingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -878,8 +1098,7 @@ pub fn get_autoscaling_v2beta1_api_resources( #[derive(Debug)] pub enum GetAutoscalingV2beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { @@ -893,8 +1112,20 @@ impl crate::Response for GetAutoscalingV2beta1APIResourcesResponse { }; Ok((GetAutoscalingV2beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetAutoscalingV2beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetAutoscalingV2beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetAutoscalingV2beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -920,8 +1151,7 @@ pub fn get_batch_api_group( #[derive(Debug)] pub enum GetBatchAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchAPIGroupResponse { @@ -935,8 +1165,20 @@ impl crate::Response for GetBatchAPIGroupResponse { }; Ok((GetBatchAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetBatchAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchAPIGroupResponse::Other(result), read)) + }, } } } @@ -962,8 +1204,7 @@ pub fn get_batch_v1_api_resources( #[derive(Debug)] pub enum GetBatchV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1APIResourcesResponse { @@ -977,8 +1218,20 @@ impl crate::Response for GetBatchV1APIResourcesResponse { }; Ok((GetBatchV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1004,8 +1257,7 @@ pub fn get_batch_v1beta1_api_resources( #[derive(Debug)] pub enum GetBatchV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV1beta1APIResourcesResponse { @@ -1019,8 +1271,20 @@ impl crate::Response for GetBatchV1beta1APIResourcesResponse { }; Ok((GetBatchV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1046,8 +1310,7 @@ pub fn get_batch_v2alpha1_api_resources( #[derive(Debug)] pub enum GetBatchV2alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetBatchV2alpha1APIResourcesResponse { @@ -1061,8 +1324,20 @@ impl crate::Response for GetBatchV2alpha1APIResourcesResponse { }; Ok((GetBatchV2alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetBatchV2alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetBatchV2alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetBatchV2alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1088,8 +1363,7 @@ pub fn get_certificates_api_group( #[derive(Debug)] pub enum GetCertificatesAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesAPIGroupResponse { @@ -1103,8 +1377,20 @@ impl crate::Response for GetCertificatesAPIGroupResponse { }; Ok((GetCertificatesAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesAPIGroupResponse::Other(result), read)) + }, } } } @@ -1130,8 +1416,7 @@ pub fn get_certificates_v1beta1_api_resources( #[derive(Debug)] pub enum GetCertificatesV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { @@ -1145,8 +1430,20 @@ impl crate::Response for GetCertificatesV1beta1APIResourcesResponse { }; Ok((GetCertificatesV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCertificatesV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCertificatesV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCertificatesV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1172,8 +1469,7 @@ pub fn get_code_version( #[derive(Debug)] pub enum GetCodeVersionResponse { Ok(crate::v1_9::apimachinery::pkg::version::Info), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCodeVersionResponse { @@ -1187,8 +1483,20 @@ impl crate::Response for GetCodeVersionResponse { }; Ok((GetCodeVersionResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCodeVersionResponse::Unauthorized, 0)), - _ => Ok((GetCodeVersionResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCodeVersionResponse::Other(result), read)) + }, } } } @@ -1214,8 +1522,7 @@ pub fn get_core_api_versions( #[derive(Debug)] pub enum GetCoreAPIVersionsResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIVersions), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreAPIVersionsResponse { @@ -1229,8 +1536,20 @@ impl crate::Response for GetCoreAPIVersionsResponse { }; Ok((GetCoreAPIVersionsResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreAPIVersionsResponse::Unauthorized, 0)), - _ => Ok((GetCoreAPIVersionsResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreAPIVersionsResponse::Other(result), read)) + }, } } } @@ -1256,8 +1575,7 @@ pub fn get_core_v1_api_resources( #[derive(Debug)] pub enum GetCoreV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetCoreV1APIResourcesResponse { @@ -1271,8 +1589,20 @@ impl crate::Response for GetCoreV1APIResourcesResponse { }; Ok((GetCoreV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetCoreV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetCoreV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetCoreV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1298,8 +1628,7 @@ pub fn get_events_api_group( #[derive(Debug)] pub enum GetEventsAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsAPIGroupResponse { @@ -1313,8 +1642,20 @@ impl crate::Response for GetEventsAPIGroupResponse { }; Ok((GetEventsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetEventsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1340,8 +1681,7 @@ pub fn get_events_v1beta1_api_resources( #[derive(Debug)] pub enum GetEventsV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetEventsV1beta1APIResourcesResponse { @@ -1355,8 +1695,20 @@ impl crate::Response for GetEventsV1beta1APIResourcesResponse { }; Ok((GetEventsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetEventsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetEventsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetEventsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1382,8 +1734,7 @@ pub fn get_extensions_api_group( #[derive(Debug)] pub enum GetExtensionsAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsAPIGroupResponse { @@ -1397,8 +1748,20 @@ impl crate::Response for GetExtensionsAPIGroupResponse { }; Ok((GetExtensionsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1424,8 +1787,7 @@ pub fn get_extensions_v1beta1_api_resources( #[derive(Debug)] pub enum GetExtensionsV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { @@ -1439,8 +1801,20 @@ impl crate::Response for GetExtensionsV1beta1APIResourcesResponse { }; Ok((GetExtensionsV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetExtensionsV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetExtensionsV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetExtensionsV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1466,8 +1840,7 @@ pub fn get_networking_api_group( #[derive(Debug)] pub enum GetNetworkingAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingAPIGroupResponse { @@ -1481,8 +1854,20 @@ impl crate::Response for GetNetworkingAPIGroupResponse { }; Ok((GetNetworkingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1508,8 +1893,7 @@ pub fn get_networking_v1_api_resources( #[derive(Debug)] pub enum GetNetworkingV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetNetworkingV1APIResourcesResponse { @@ -1523,8 +1907,20 @@ impl crate::Response for GetNetworkingV1APIResourcesResponse { }; Ok((GetNetworkingV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetNetworkingV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetNetworkingV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetNetworkingV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1550,8 +1946,7 @@ pub fn get_policy_api_group( #[derive(Debug)] pub enum GetPolicyAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyAPIGroupResponse { @@ -1565,8 +1960,20 @@ impl crate::Response for GetPolicyAPIGroupResponse { }; Ok((GetPolicyAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetPolicyAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyAPIGroupResponse::Other(result), read)) + }, } } } @@ -1592,8 +1999,7 @@ pub fn get_policy_v1beta1_api_resources( #[derive(Debug)] pub enum GetPolicyV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetPolicyV1beta1APIResourcesResponse { @@ -1607,8 +2013,20 @@ impl crate::Response for GetPolicyV1beta1APIResourcesResponse { }; Ok((GetPolicyV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetPolicyV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetPolicyV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetPolicyV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1634,8 +2052,7 @@ pub fn get_rbac_authorization_api_group( #[derive(Debug)] pub enum GetRbacAuthorizationAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationAPIGroupResponse { @@ -1649,8 +2066,20 @@ impl crate::Response for GetRbacAuthorizationAPIGroupResponse { }; Ok((GetRbacAuthorizationAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationAPIGroupResponse::Other(result), read)) + }, } } } @@ -1676,8 +2105,7 @@ pub fn get_rbac_authorization_v1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { @@ -1691,8 +2119,20 @@ impl crate::Response for GetRbacAuthorizationV1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1718,8 +2158,7 @@ pub fn get_rbac_authorization_v1alpha1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { @@ -1733,8 +2172,20 @@ impl crate::Response for GetRbacAuthorizationV1alpha1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1760,8 +2211,7 @@ pub fn get_rbac_authorization_v1beta1_api_resources( #[derive(Debug)] pub enum GetRbacAuthorizationV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { @@ -1775,8 +2225,20 @@ impl crate::Response for GetRbacAuthorizationV1beta1APIResourcesResponse { }; Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetRbacAuthorizationV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1802,8 +2264,7 @@ pub fn get_scheduling_api_group( #[derive(Debug)] pub enum GetSchedulingAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingAPIGroupResponse { @@ -1817,8 +2278,20 @@ impl crate::Response for GetSchedulingAPIGroupResponse { }; Ok((GetSchedulingAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingAPIGroupResponse::Other(result), read)) + }, } } } @@ -1844,8 +2317,7 @@ pub fn get_scheduling_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSchedulingV1alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { @@ -1859,8 +2331,20 @@ impl crate::Response for GetSchedulingV1alpha1APIResourcesResponse { }; Ok((GetSchedulingV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSchedulingV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSchedulingV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSchedulingV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1886,8 +2370,7 @@ pub fn get_settings_api_group( #[derive(Debug)] pub enum GetSettingsAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsAPIGroupResponse { @@ -1901,8 +2384,20 @@ impl crate::Response for GetSettingsAPIGroupResponse { }; Ok((GetSettingsAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetSettingsAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsAPIGroupResponse::Other(result), read)) + }, } } } @@ -1928,8 +2423,7 @@ pub fn get_settings_v1alpha1_api_resources( #[derive(Debug)] pub enum GetSettingsV1alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { @@ -1943,8 +2437,20 @@ impl crate::Response for GetSettingsV1alpha1APIResourcesResponse { }; Ok((GetSettingsV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetSettingsV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetSettingsV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetSettingsV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -1970,8 +2476,7 @@ pub fn get_storage_api_group( #[derive(Debug)] pub enum GetStorageAPIGroupResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIGroup), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageAPIGroupResponse { @@ -1985,8 +2490,20 @@ impl crate::Response for GetStorageAPIGroupResponse { }; Ok((GetStorageAPIGroupResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageAPIGroupResponse::Unauthorized, 0)), - _ => Ok((GetStorageAPIGroupResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageAPIGroupResponse::Other(result), read)) + }, } } } @@ -2012,8 +2529,7 @@ pub fn get_storage_v1_api_resources( #[derive(Debug)] pub enum GetStorageV1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1APIResourcesResponse { @@ -2027,8 +2543,20 @@ impl crate::Response for GetStorageV1APIResourcesResponse { }; Ok((GetStorageV1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2054,8 +2582,7 @@ pub fn get_storage_v1alpha1_api_resources( #[derive(Debug)] pub enum GetStorageV1alpha1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1alpha1APIResourcesResponse { @@ -2069,8 +2596,20 @@ impl crate::Response for GetStorageV1alpha1APIResourcesResponse { }; Ok((GetStorageV1alpha1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1alpha1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1alpha1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1alpha1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2096,8 +2635,7 @@ pub fn get_storage_v1beta1_api_resources( #[derive(Debug)] pub enum GetStorageV1beta1APIResourcesResponse { Ok(crate::v1_9::apimachinery::pkg::apis::meta::v1::APIResourceList), - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for GetStorageV1beta1APIResourcesResponse { @@ -2111,8 +2649,20 @@ impl crate::Response for GetStorageV1beta1APIResourcesResponse { }; Ok((GetStorageV1beta1APIResourcesResponse::Ok(result), buf.len())) }, - http::StatusCode::UNAUTHORIZED => Ok((GetStorageV1beta1APIResourcesResponse::Unauthorized, 0)), - _ => Ok((GetStorageV1beta1APIResourcesResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((GetStorageV1beta1APIResourcesResponse::Other(result), read)) + }, } } } @@ -2142,15 +2692,26 @@ pub fn log_file_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_handler`] #[derive(Debug)] pub enum LogFileHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileHandlerResponse::Other(result), read)) + }, } } } @@ -2173,15 +2734,26 @@ pub fn log_file_list_handler( /// Use `::try_from_parts` to parse the HTTP response body of [`log_file_list_handler`] #[derive(Debug)] pub enum LogFileListHandlerResponse { - Unauthorized, - Other, + Other(Result, serde_json::Error>), } impl crate::Response for LogFileListHandlerResponse { - fn try_from_parts(status_code: http::StatusCode, _: &[u8]) -> Result<(Self, usize), crate::ResponseError> { + fn try_from_parts(status_code: http::StatusCode, buf: &[u8]) -> Result<(Self, usize), crate::ResponseError> { match status_code { - http::StatusCode::UNAUTHORIZED => Ok((LogFileListHandlerResponse::Unauthorized, 0)), - _ => Ok((LogFileListHandlerResponse::Other, 0)), + _ => { + let (result, read) = + if buf.is_empty() { + (Ok(None), 0) + } + else { + match serde_json::from_slice(buf) { + Ok(value) => (Ok(Some(value)), buf.len()), + Err(ref err) if err.is_eof() => return Err(crate::ResponseError::NeedMoreData), + Err(err) => (Err(err), 0), + } + }; + Ok((LogFileListHandlerResponse::Other(result), read)) + }, } } }