diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 500a33199..65d674fb2 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -102910,14 +102910,26 @@ components: description: Whether Auto Test Retries are enabled for this service. example: false type: boolean + auto_test_retries_enabled_is_overridden: + description: Whether the Auto Test Retries setting is overridden at the service level. + example: false + type: boolean code_coverage_enabled: description: Whether Code Coverage is enabled for this service. example: false type: boolean + code_coverage_enabled_is_overridden: + description: Whether the Code Coverage setting is overridden at the service level. + example: false + type: boolean early_flake_detection_enabled: description: Whether Early Flake Detection is enabled for this service. example: false type: boolean + early_flake_detection_enabled_is_overridden: + description: Whether the Early Flake Detection setting is overridden at the service level. + example: false + type: boolean env: description: The environment name. example: prod @@ -102926,9 +102938,13 @@ components: description: Whether Failed Test Replay is enabled for this service. example: false type: boolean + failed_test_replay_enabled_is_overridden: + description: Whether the Failed Test Replay setting is overridden at the service level. + example: false + type: boolean pr_comments_enabled: - description: Whether PR Comments are enabled for this service. - example: true + description: Whether PR Comments are enabled. This value reflects the repository-level setting and cannot be overridden at the service level. + example: false type: boolean repository_id: description: The repository identifier. @@ -102940,7 +102956,11 @@ components: type: string test_impact_analysis_enabled: description: Whether Test Impact Analysis is enabled for this service. - example: false + example: true + type: boolean + test_impact_analysis_enabled_is_overridden: + description: Whether the Test Impact Analysis setting is overridden at the service level. + example: true type: boolean type: object TestOptimizationServiceSettingsData: @@ -102950,7 +102970,7 @@ components: $ref: "#/components/schemas/TestOptimizationServiceSettingsAttributes" id: description: Unique identifier for the service settings. - example: github.com/datadog/shopist::shopist::prod + example: 9b8a7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d type: string type: $ref: "#/components/schemas/TestOptimizationServiceSettingsType" @@ -102993,17 +103013,30 @@ components: description: |- Attributes for updating Test Optimization service settings. All non-required fields are optional; only provided fields will be updated. + Setting a field to `null` is a no-op. To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. properties: auto_test_retries_enabled: - description: Whether Auto Test Retries are enabled for this service. + description: Whether Auto Test Retries are enabled for this service. Setting to `null` is a no-op; use `auto_test_retries_enabled_inherit` to reset to repository-level inheritance. + example: false + type: boolean + auto_test_retries_enabled_inherit: + description: When `true`, resets the Auto Test Retries setting to inherit from the repository level. example: false type: boolean code_coverage_enabled: - description: Whether Code Coverage is enabled for this service. + description: Whether Code Coverage is enabled for this service. Setting to `null` is a no-op; use `code_coverage_enabled_inherit` to reset to repository-level inheritance. + example: false + type: boolean + code_coverage_enabled_inherit: + description: When `true`, resets the Code Coverage setting to inherit from the repository level. example: false type: boolean early_flake_detection_enabled: - description: Whether Early Flake Detection is enabled for this service. + description: Whether Early Flake Detection is enabled for this service. Setting to `null` is a no-op; use `early_flake_detection_enabled_inherit` to reset to repository-level inheritance. + example: false + type: boolean + early_flake_detection_enabled_inherit: + description: When `true`, resets the Early Flake Detection setting to inherit from the repository level. example: false type: boolean env: @@ -103011,12 +103044,16 @@ components: example: prod type: string failed_test_replay_enabled: - description: Whether Failed Test Replay is enabled for this service. + description: Whether Failed Test Replay is enabled for this service. Setting to `null` is a no-op; use `failed_test_replay_enabled_inherit` to reset to repository-level inheritance. + example: false + type: boolean + failed_test_replay_enabled_inherit: + description: When `true`, resets the Failed Test Replay setting to inherit from the repository level. example: false type: boolean pr_comments_enabled: - description: Whether PR Comments are enabled for this service. - example: true + description: This field is ignored. PR Comments cannot be overridden at the service level. + example: false type: boolean repository_id: description: The repository identifier. @@ -103029,8 +103066,12 @@ components: minLength: 1 type: string test_impact_analysis_enabled: - description: Whether Test Impact Analysis is enabled for this service. - example: false + description: Whether Test Impact Analysis is enabled for this service. Setting to `null` is a no-op; use `test_impact_analysis_enabled_inherit` to reset to repository-level inheritance. + example: true + type: boolean + test_impact_analysis_enabled_inherit: + description: When `true`, resets the Test Impact Analysis setting to inherit from the repository level. + example: true type: boolean required: - repository_id @@ -121112,7 +121153,9 @@ paths: patch: description: |- Partially update Test Optimization settings for a specific service identified by repository, service name, and environment. - Only provided fields are updated; null or omitted fields are left unchanged. + Only provided fields are updated; setting a field to `null` is a no-op. + To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. + The `pr_comments_enabled` field is ignored as it cannot be overridden at the service level. operationId: UpdateTestOptimizationServiceSettings requestBody: content: @@ -121122,15 +121165,10 @@ paths: value: data: attributes: - auto_test_retries_enabled: false - code_coverage_enabled: false - early_flake_detection_enabled: false env: prod - failed_test_replay_enabled: false - pr_comments_enabled: true repository_id: github.com/datadog/test-service service_name: test-service - test_impact_analysis_enabled: false + test_impact_analysis_enabled_inherit: true type: test_optimization_update_service_settings_request schema: $ref: "#/components/schemas/TestOptimizationUpdateServiceSettingsRequest" @@ -121145,15 +121183,20 @@ paths: data: attributes: auto_test_retries_enabled: false + auto_test_retries_enabled_is_overridden: false code_coverage_enabled: false + code_coverage_enabled_is_overridden: false early_flake_detection_enabled: false + early_flake_detection_enabled_is_overridden: false env: prod failed_test_replay_enabled: false - pr_comments_enabled: true + failed_test_replay_enabled_is_overridden: false + pr_comments_enabled: false repository_id: github.com/datadog/test-service service_name: test-service - test_impact_analysis_enabled: false - id: github.com/datadog/test-service::test-service::prod + test_impact_analysis_enabled: true + test_impact_analysis_enabled_is_overridden: true + id: 9b8a7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d type: test_optimization_service_settings schema: $ref: "#/components/schemas/TestOptimizationServiceSettingsResponse" @@ -121207,15 +121250,20 @@ paths: data: attributes: auto_test_retries_enabled: false + auto_test_retries_enabled_is_overridden: false code_coverage_enabled: false + code_coverage_enabled_is_overridden: false early_flake_detection_enabled: false + early_flake_detection_enabled_is_overridden: false env: prod failed_test_replay_enabled: false - pr_comments_enabled: true + failed_test_replay_enabled_is_overridden: false + pr_comments_enabled: false repository_id: github.com/datadog/test-service service_name: test-service - test_impact_analysis_enabled: false - id: github.com/datadog/test-service::test-service::prod + test_impact_analysis_enabled: true + test_impact_analysis_enabled_is_overridden: true + id: 9b8a7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d type: test_optimization_service_settings schema: $ref: "#/components/schemas/TestOptimizationServiceSettingsResponse" diff --git a/examples/v2_test-optimization_UpdateTestOptimizationServiceSettings.rs b/examples/v2_test-optimization_UpdateTestOptimizationServiceSettings.rs index 666c172e1..4b357f4ea 100644 --- a/examples/v2_test-optimization_UpdateTestOptimizationServiceSettings.rs +++ b/examples/v2_test-optimization_UpdateTestOptimizationServiceSettings.rs @@ -16,12 +16,17 @@ async fn main() { "shopist".to_string(), ) .auto_test_retries_enabled(false) + .auto_test_retries_enabled_inherit(false) .code_coverage_enabled(false) + .code_coverage_enabled_inherit(false) .early_flake_detection_enabled(false) + .early_flake_detection_enabled_inherit(false) .env("prod".to_string()) .failed_test_replay_enabled(false) - .pr_comments_enabled(true) - .test_impact_analysis_enabled(false), + .failed_test_replay_enabled_inherit(false) + .pr_comments_enabled(false) + .test_impact_analysis_enabled(true) + .test_impact_analysis_enabled_inherit(true), TestOptimizationUpdateServiceSettingsRequestDataType ::TEST_OPTIMIZATION_UPDATE_SERVICE_SETTINGS_REQUEST, ), diff --git a/src/datadogV2/api/api_test_optimization.rs b/src/datadogV2/api/api_test_optimization.rs index 665486480..363a77e32 100644 --- a/src/datadogV2/api/api_test_optimization.rs +++ b/src/datadogV2/api/api_test_optimization.rs @@ -1165,7 +1165,9 @@ impl TestOptimizationAPI { } /// Partially update Test Optimization settings for a specific service identified by repository, service name, and environment. - /// Only provided fields are updated; null or omitted fields are left unchanged. + /// Only provided fields are updated; setting a field to `null` is a no-op. + /// To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. + /// The `pr_comments_enabled` field is ignored as it cannot be overridden at the service level. pub async fn update_test_optimization_service_settings( &self, body: crate::datadogV2::model::TestOptimizationUpdateServiceSettingsRequest, @@ -1191,7 +1193,9 @@ impl TestOptimizationAPI { } /// Partially update Test Optimization settings for a specific service identified by repository, service name, and environment. - /// Only provided fields are updated; null or omitted fields are left unchanged. + /// Only provided fields are updated; setting a field to `null` is a no-op. + /// To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. + /// The `pr_comments_enabled` field is ignored as it cannot be overridden at the service level. pub async fn update_test_optimization_service_settings_with_http_info( &self, body: crate::datadogV2::model::TestOptimizationUpdateServiceSettingsRequest, diff --git a/src/datadogV2/model/model_test_optimization_service_settings_attributes.rs b/src/datadogV2/model/model_test_optimization_service_settings_attributes.rs index e6666f202..2b3ba5b76 100644 --- a/src/datadogV2/model/model_test_optimization_service_settings_attributes.rs +++ b/src/datadogV2/model/model_test_optimization_service_settings_attributes.rs @@ -14,19 +14,31 @@ pub struct TestOptimizationServiceSettingsAttributes { /// Whether Auto Test Retries are enabled for this service. #[serde(rename = "auto_test_retries_enabled")] pub auto_test_retries_enabled: Option, + /// Whether the Auto Test Retries setting is overridden at the service level. + #[serde(rename = "auto_test_retries_enabled_is_overridden")] + pub auto_test_retries_enabled_is_overridden: Option, /// Whether Code Coverage is enabled for this service. #[serde(rename = "code_coverage_enabled")] pub code_coverage_enabled: Option, + /// Whether the Code Coverage setting is overridden at the service level. + #[serde(rename = "code_coverage_enabled_is_overridden")] + pub code_coverage_enabled_is_overridden: Option, /// Whether Early Flake Detection is enabled for this service. #[serde(rename = "early_flake_detection_enabled")] pub early_flake_detection_enabled: Option, + /// Whether the Early Flake Detection setting is overridden at the service level. + #[serde(rename = "early_flake_detection_enabled_is_overridden")] + pub early_flake_detection_enabled_is_overridden: Option, /// The environment name. #[serde(rename = "env")] pub env: Option, /// Whether Failed Test Replay is enabled for this service. #[serde(rename = "failed_test_replay_enabled")] pub failed_test_replay_enabled: Option, - /// Whether PR Comments are enabled for this service. + /// Whether the Failed Test Replay setting is overridden at the service level. + #[serde(rename = "failed_test_replay_enabled_is_overridden")] + pub failed_test_replay_enabled_is_overridden: Option, + /// Whether PR Comments are enabled. This value reflects the repository-level setting and cannot be overridden at the service level. #[serde(rename = "pr_comments_enabled")] pub pr_comments_enabled: Option, /// The repository identifier. @@ -38,6 +50,9 @@ pub struct TestOptimizationServiceSettingsAttributes { /// Whether Test Impact Analysis is enabled for this service. #[serde(rename = "test_impact_analysis_enabled")] pub test_impact_analysis_enabled: Option, + /// Whether the Test Impact Analysis setting is overridden at the service level. + #[serde(rename = "test_impact_analysis_enabled_is_overridden")] + pub test_impact_analysis_enabled_is_overridden: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -49,14 +64,19 @@ impl TestOptimizationServiceSettingsAttributes { pub fn new() -> TestOptimizationServiceSettingsAttributes { TestOptimizationServiceSettingsAttributes { auto_test_retries_enabled: None, + auto_test_retries_enabled_is_overridden: None, code_coverage_enabled: None, + code_coverage_enabled_is_overridden: None, early_flake_detection_enabled: None, + early_flake_detection_enabled_is_overridden: None, env: None, failed_test_replay_enabled: None, + failed_test_replay_enabled_is_overridden: None, pr_comments_enabled: None, repository_id: None, service_name: None, test_impact_analysis_enabled: None, + test_impact_analysis_enabled_is_overridden: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -67,16 +87,31 @@ impl TestOptimizationServiceSettingsAttributes { self } + pub fn auto_test_retries_enabled_is_overridden(mut self, value: bool) -> Self { + self.auto_test_retries_enabled_is_overridden = Some(value); + self + } + pub fn code_coverage_enabled(mut self, value: bool) -> Self { self.code_coverage_enabled = Some(value); self } + pub fn code_coverage_enabled_is_overridden(mut self, value: bool) -> Self { + self.code_coverage_enabled_is_overridden = Some(value); + self + } + pub fn early_flake_detection_enabled(mut self, value: bool) -> Self { self.early_flake_detection_enabled = Some(value); self } + pub fn early_flake_detection_enabled_is_overridden(mut self, value: bool) -> Self { + self.early_flake_detection_enabled_is_overridden = Some(value); + self + } + pub fn env(mut self, value: String) -> Self { self.env = Some(value); self @@ -87,6 +122,11 @@ impl TestOptimizationServiceSettingsAttributes { self } + pub fn failed_test_replay_enabled_is_overridden(mut self, value: bool) -> Self { + self.failed_test_replay_enabled_is_overridden = Some(value); + self + } + pub fn pr_comments_enabled(mut self, value: bool) -> Self { self.pr_comments_enabled = Some(value); self @@ -107,6 +147,11 @@ impl TestOptimizationServiceSettingsAttributes { self } + pub fn test_impact_analysis_enabled_is_overridden(mut self, value: bool) -> Self { + self.test_impact_analysis_enabled_is_overridden = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -140,14 +185,19 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { M: MapAccess<'a>, { let mut auto_test_retries_enabled: Option = None; + let mut auto_test_retries_enabled_is_overridden: Option = None; let mut code_coverage_enabled: Option = None; + let mut code_coverage_enabled_is_overridden: Option = None; let mut early_flake_detection_enabled: Option = None; + let mut early_flake_detection_enabled_is_overridden: Option = None; let mut env: Option = None; let mut failed_test_replay_enabled: Option = None; + let mut failed_test_replay_enabled_is_overridden: Option = None; let mut pr_comments_enabled: Option = None; let mut repository_id: Option = None; let mut service_name: Option = None; let mut test_impact_analysis_enabled: Option = None; + let mut test_impact_analysis_enabled_is_overridden: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -163,6 +213,13 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { auto_test_retries_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "auto_test_retries_enabled_is_overridden" => { + if v.is_null() { + continue; + } + auto_test_retries_enabled_is_overridden = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "code_coverage_enabled" => { if v.is_null() { continue; @@ -170,6 +227,13 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { code_coverage_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "code_coverage_enabled_is_overridden" => { + if v.is_null() { + continue; + } + code_coverage_enabled_is_overridden = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "early_flake_detection_enabled" => { if v.is_null() { continue; @@ -177,6 +241,13 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { early_flake_detection_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "early_flake_detection_enabled_is_overridden" => { + if v.is_null() { + continue; + } + early_flake_detection_enabled_is_overridden = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "env" => { if v.is_null() { continue; @@ -190,6 +261,13 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { failed_test_replay_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "failed_test_replay_enabled_is_overridden" => { + if v.is_null() { + continue; + } + failed_test_replay_enabled_is_overridden = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "pr_comments_enabled" => { if v.is_null() { continue; @@ -218,6 +296,13 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { test_impact_analysis_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "test_impact_analysis_enabled_is_overridden" => { + if v.is_null() { + continue; + } + test_impact_analysis_enabled_is_overridden = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { additional_properties.insert(k, value); @@ -228,14 +313,19 @@ impl<'de> Deserialize<'de> for TestOptimizationServiceSettingsAttributes { let content = TestOptimizationServiceSettingsAttributes { auto_test_retries_enabled, + auto_test_retries_enabled_is_overridden, code_coverage_enabled, + code_coverage_enabled_is_overridden, early_flake_detection_enabled, + early_flake_detection_enabled_is_overridden, env, failed_test_replay_enabled, + failed_test_replay_enabled_is_overridden, pr_comments_enabled, repository_id, service_name, test_impact_analysis_enabled, + test_impact_analysis_enabled_is_overridden, additional_properties, _unparsed, }; diff --git a/src/datadogV2/model/model_test_optimization_update_service_settings_request_attributes.rs b/src/datadogV2/model/model_test_optimization_update_service_settings_request_attributes.rs index 07c3e1923..42d8c9fa8 100644 --- a/src/datadogV2/model/model_test_optimization_update_service_settings_request_attributes.rs +++ b/src/datadogV2/model/model_test_optimization_update_service_settings_request_attributes.rs @@ -8,26 +8,39 @@ use std::fmt::{self, Formatter}; /// Attributes for updating Test Optimization service settings. /// All non-required fields are optional; only provided fields will be updated. +/// Setting a field to `null` is a no-op. To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] pub struct TestOptimizationUpdateServiceSettingsRequestAttributes { - /// Whether Auto Test Retries are enabled for this service. + /// Whether Auto Test Retries are enabled for this service. Setting to `null` is a no-op; use `auto_test_retries_enabled_inherit` to reset to repository-level inheritance. #[serde(rename = "auto_test_retries_enabled")] pub auto_test_retries_enabled: Option, - /// Whether Code Coverage is enabled for this service. + /// When `true`, resets the Auto Test Retries setting to inherit from the repository level. + #[serde(rename = "auto_test_retries_enabled_inherit")] + pub auto_test_retries_enabled_inherit: Option, + /// Whether Code Coverage is enabled for this service. Setting to `null` is a no-op; use `code_coverage_enabled_inherit` to reset to repository-level inheritance. #[serde(rename = "code_coverage_enabled")] pub code_coverage_enabled: Option, - /// Whether Early Flake Detection is enabled for this service. + /// When `true`, resets the Code Coverage setting to inherit from the repository level. + #[serde(rename = "code_coverage_enabled_inherit")] + pub code_coverage_enabled_inherit: Option, + /// Whether Early Flake Detection is enabled for this service. Setting to `null` is a no-op; use `early_flake_detection_enabled_inherit` to reset to repository-level inheritance. #[serde(rename = "early_flake_detection_enabled")] pub early_flake_detection_enabled: Option, + /// When `true`, resets the Early Flake Detection setting to inherit from the repository level. + #[serde(rename = "early_flake_detection_enabled_inherit")] + pub early_flake_detection_enabled_inherit: Option, /// The environment name. If omitted, defaults to `none`. #[serde(rename = "env")] pub env: Option, - /// Whether Failed Test Replay is enabled for this service. + /// Whether Failed Test Replay is enabled for this service. Setting to `null` is a no-op; use `failed_test_replay_enabled_inherit` to reset to repository-level inheritance. #[serde(rename = "failed_test_replay_enabled")] pub failed_test_replay_enabled: Option, - /// Whether PR Comments are enabled for this service. + /// When `true`, resets the Failed Test Replay setting to inherit from the repository level. + #[serde(rename = "failed_test_replay_enabled_inherit")] + pub failed_test_replay_enabled_inherit: Option, + /// This field is ignored. PR Comments cannot be overridden at the service level. #[serde(rename = "pr_comments_enabled")] pub pr_comments_enabled: Option, /// The repository identifier. @@ -36,9 +49,12 @@ pub struct TestOptimizationUpdateServiceSettingsRequestAttributes { /// The service name. #[serde(rename = "service_name")] pub service_name: String, - /// Whether Test Impact Analysis is enabled for this service. + /// Whether Test Impact Analysis is enabled for this service. Setting to `null` is a no-op; use `test_impact_analysis_enabled_inherit` to reset to repository-level inheritance. #[serde(rename = "test_impact_analysis_enabled")] pub test_impact_analysis_enabled: Option, + /// When `true`, resets the Test Impact Analysis setting to inherit from the repository level. + #[serde(rename = "test_impact_analysis_enabled_inherit")] + pub test_impact_analysis_enabled_inherit: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -53,14 +69,19 @@ impl TestOptimizationUpdateServiceSettingsRequestAttributes { ) -> TestOptimizationUpdateServiceSettingsRequestAttributes { TestOptimizationUpdateServiceSettingsRequestAttributes { auto_test_retries_enabled: None, + auto_test_retries_enabled_inherit: None, code_coverage_enabled: None, + code_coverage_enabled_inherit: None, early_flake_detection_enabled: None, + early_flake_detection_enabled_inherit: None, env: None, failed_test_replay_enabled: None, + failed_test_replay_enabled_inherit: None, pr_comments_enabled: None, repository_id, service_name, test_impact_analysis_enabled: None, + test_impact_analysis_enabled_inherit: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -71,16 +92,31 @@ impl TestOptimizationUpdateServiceSettingsRequestAttributes { self } + pub fn auto_test_retries_enabled_inherit(mut self, value: bool) -> Self { + self.auto_test_retries_enabled_inherit = Some(value); + self + } + pub fn code_coverage_enabled(mut self, value: bool) -> Self { self.code_coverage_enabled = Some(value); self } + pub fn code_coverage_enabled_inherit(mut self, value: bool) -> Self { + self.code_coverage_enabled_inherit = Some(value); + self + } + pub fn early_flake_detection_enabled(mut self, value: bool) -> Self { self.early_flake_detection_enabled = Some(value); self } + pub fn early_flake_detection_enabled_inherit(mut self, value: bool) -> Self { + self.early_flake_detection_enabled_inherit = Some(value); + self + } + pub fn env(mut self, value: String) -> Self { self.env = Some(value); self @@ -91,6 +127,11 @@ impl TestOptimizationUpdateServiceSettingsRequestAttributes { self } + pub fn failed_test_replay_enabled_inherit(mut self, value: bool) -> Self { + self.failed_test_replay_enabled_inherit = Some(value); + self + } + pub fn pr_comments_enabled(mut self, value: bool) -> Self { self.pr_comments_enabled = Some(value); self @@ -101,6 +142,11 @@ impl TestOptimizationUpdateServiceSettingsRequestAttributes { self } + pub fn test_impact_analysis_enabled_inherit(mut self, value: bool) -> Self { + self.test_impact_analysis_enabled_inherit = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -128,14 +174,19 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri M: MapAccess<'a>, { let mut auto_test_retries_enabled: Option = None; + let mut auto_test_retries_enabled_inherit: Option = None; let mut code_coverage_enabled: Option = None; + let mut code_coverage_enabled_inherit: Option = None; let mut early_flake_detection_enabled: Option = None; + let mut early_flake_detection_enabled_inherit: Option = None; let mut env: Option = None; let mut failed_test_replay_enabled: Option = None; + let mut failed_test_replay_enabled_inherit: Option = None; let mut pr_comments_enabled: Option = None; let mut repository_id: Option = None; let mut service_name: Option = None; let mut test_impact_analysis_enabled: Option = None; + let mut test_impact_analysis_enabled_inherit: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -151,6 +202,13 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri auto_test_retries_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "auto_test_retries_enabled_inherit" => { + if v.is_null() { + continue; + } + auto_test_retries_enabled_inherit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "code_coverage_enabled" => { if v.is_null() { continue; @@ -158,6 +216,13 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri code_coverage_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "code_coverage_enabled_inherit" => { + if v.is_null() { + continue; + } + code_coverage_enabled_inherit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "early_flake_detection_enabled" => { if v.is_null() { continue; @@ -165,6 +230,13 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri early_flake_detection_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "early_flake_detection_enabled_inherit" => { + if v.is_null() { + continue; + } + early_flake_detection_enabled_inherit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "env" => { if v.is_null() { continue; @@ -178,6 +250,13 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri failed_test_replay_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "failed_test_replay_enabled_inherit" => { + if v.is_null() { + continue; + } + failed_test_replay_enabled_inherit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } "pr_comments_enabled" => { if v.is_null() { continue; @@ -200,6 +279,13 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri test_impact_analysis_enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } + "test_impact_analysis_enabled_inherit" => { + if v.is_null() { + continue; + } + test_impact_analysis_enabled_inherit = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { additional_properties.insert(k, value); @@ -214,14 +300,19 @@ impl<'de> Deserialize<'de> for TestOptimizationUpdateServiceSettingsRequestAttri let content = TestOptimizationUpdateServiceSettingsRequestAttributes { auto_test_retries_enabled, + auto_test_retries_enabled_inherit, code_coverage_enabled, + code_coverage_enabled_inherit, early_flake_detection_enabled, + early_flake_detection_enabled_inherit, env, failed_test_replay_enabled, + failed_test_replay_enabled_inherit, pr_comments_enabled, repository_id, service_name, test_impact_analysis_enabled, + test_impact_analysis_enabled_inherit, additional_properties, _unparsed, }; diff --git a/src/datadogV2/model/model_test_optimization_update_service_settings_request_data.rs b/src/datadogV2/model/model_test_optimization_update_service_settings_request_data.rs index 394c461bb..838293a3f 100644 --- a/src/datadogV2/model/model_test_optimization_update_service_settings_request_data.rs +++ b/src/datadogV2/model/model_test_optimization_update_service_settings_request_data.rs @@ -13,6 +13,7 @@ use std::fmt::{self, Formatter}; pub struct TestOptimizationUpdateServiceSettingsRequestData { /// Attributes for updating Test Optimization service settings. /// All non-required fields are optional; only provided fields will be updated. + /// Setting a field to `null` is a no-op. To reset a setting to inherit from the repository level, use the corresponding `_inherit` field. #[serde(rename = "attributes")] pub attributes: crate::datadogV2::model::TestOptimizationUpdateServiceSettingsRequestAttributes, /// JSON:API type for update service settings request. diff --git a/tests/scenarios/features/v2/test_optimization.feature b/tests/scenarios/features/v2/test_optimization.feature index c363d29f0..342eda12e 100644 --- a/tests/scenarios/features/v2/test_optimization.feature +++ b/tests/scenarios/features/v2/test_optimization.feature @@ -187,21 +187,21 @@ Feature: Test Optimization @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "Bad Request" response Given new "UpdateTestOptimizationServiceSettings" request - And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "Not Found" response Given new "UpdateTestOptimizationServiceSettings" request - And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 404 Not Found @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "OK" response Given new "UpdateTestOptimizationServiceSettings" request - And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "code_coverage_enabled": false, "early_flake_detection_enabled": false, "env": "prod", "failed_test_replay_enabled": false, "pr_comments_enabled": true, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": false}, "type": "test_optimization_update_service_settings_request"}} + And body with value {"data": {"attributes": {"auto_test_retries_enabled": false, "auto_test_retries_enabled_inherit": false, "code_coverage_enabled": false, "code_coverage_enabled_inherit": false, "early_flake_detection_enabled": false, "early_flake_detection_enabled_inherit": false, "env": "prod", "failed_test_replay_enabled": false, "failed_test_replay_enabled_inherit": false, "pr_comments_enabled": false, "repository_id": "github.com/datadog/shopist", "service_name": "shopist", "test_impact_analysis_enabled": true, "test_impact_analysis_enabled_inherit": true}, "type": "test_optimization_update_service_settings_request"}} When the request is sent Then the response status is 200 OK