From b4d240d8d64fc1cb586c1143706db0fbbf09c904 Mon Sep 17 00:00:00 2001 From: Charlie Zhang Date: Mon, 8 Jun 2026 09:47:24 -0400 Subject: [PATCH 1/4] Support x-keep-typed-in-additional-properties in Rust model generator When a schema sets `x-keep-typed-in-additional-properties: true`, pre-insert every key into `additional_properties` before the match dispatch so typed and untyped fields are both accessible from a single map. Co-Authored-By: Claude Sonnet 4.6 --- .generator/src/generator/templates/model_simple.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.generator/src/generator/templates/model_simple.j2 b/.generator/src/generator/templates/model_simple.j2 index b0c4649890..d791fadb49 100644 --- a/.generator/src/generator/templates/model_simple.j2 +++ b/.generator/src/generator/templates/model_simple.j2 @@ -118,6 +118,11 @@ impl<'de> Deserialize<'de> for {{ name }} { let mut _unparsed = false; while let Some((k, v)) = map.next_entry::()? { + {%- if additionalProperties != false and model.get("x-keep-typed-in-additional-properties") %} + if let Ok(ap_value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k.clone(), ap_value); + } + {%- endif %} match k.as_str() { {%- for attr, schema in model.get("properties", {}).items() %} {%- set required = attr in model.required %} From f1517d3ea6fbf317a6c02655ee7cfcce473fb3f8 Mon Sep 17 00:00:00 2001 From: Charlie Zhang Date: Mon, 8 Jun 2026 10:11:02 -0400 Subject: [PATCH 2/4] docs: clarify that if let Ok guard on from_value is infallible for serde_json::Value Add inline comment explaining that deserializing into serde_json::Value always succeeds, so the Ok branch always fires. The guard future-proofs against typed additionalProperties schemas where the conversion could fail. Co-Authored-By: Claude Sonnet 4.6 --- .generator/src/generator/templates/model_simple.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/.generator/src/generator/templates/model_simple.j2 b/.generator/src/generator/templates/model_simple.j2 index d791fadb49..b843cae277 100644 --- a/.generator/src/generator/templates/model_simple.j2 +++ b/.generator/src/generator/templates/model_simple.j2 @@ -119,6 +119,7 @@ impl<'de> Deserialize<'de> for {{ name }} { while let Some((k, v)) = map.next_entry::()? { {%- if additionalProperties != false and model.get("x-keep-typed-in-additional-properties") %} + // from_value:: is infallible; the Ok guard future-proofs typed AP schemas. if let Ok(ap_value) = serde_json::from_value(v.clone()) { additional_properties.insert(k.clone(), ap_value); } From 95db400d07cd8bb3cf22a00148b67e8b870de108 Mon Sep 17 00:00:00 2001 From: Charlie Zhang Date: Mon, 8 Jun 2026 10:59:10 -0400 Subject: [PATCH 3/4] docs: clarify silent-drop behavior for typed AP schemas in if let Ok comment "future-proofs" implied graceful handling; the comment now accurately notes that a type mismatch silently drops the entry, same as the catch-all arm. Co-Authored-By: Claude Sonnet 4.6 --- .generator/src/generator/templates/model_simple.j2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.generator/src/generator/templates/model_simple.j2 b/.generator/src/generator/templates/model_simple.j2 index b843cae277..ebeeae3f3a 100644 --- a/.generator/src/generator/templates/model_simple.j2 +++ b/.generator/src/generator/templates/model_simple.j2 @@ -119,7 +119,8 @@ impl<'de> Deserialize<'de> for {{ name }} { while let Some((k, v)) = map.next_entry::()? { {%- if additionalProperties != false and model.get("x-keep-typed-in-additional-properties") %} - // from_value:: is infallible; the Ok guard future-proofs typed AP schemas. + // from_value:: is infallible so Ok always fires; + // for typed AP schemas a type mismatch silently drops the entry (same as the catch-all arm). if let Ok(ap_value) = serde_json::from_value(v.clone()) { additional_properties.insert(k.clone(), ap_value); } From 66e87390edcf3b98074cec601d5e33a8509e9299 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 16 Jun 2026 06:14:14 +0000 Subject: [PATCH 4/4] Regenerate client from commit 9c9852b of spec repo --- .generator/schemas/v2/openapi.yaml | 5601 +++++++++++++---- ...egration_CreateGoogleChatTargetAudience.rs | 29 + ...tegration_DeleteGoogleChatDelegatedUser.rs | 17 + ...ntegration_DeleteGoogleChatOrganization.rs | 17 + ...egration_DeleteGoogleChatTargetAudience.rs | 20 + ...-integration_GetGoogleChatDelegatedUser.rs | 17 + ...t-integration_GetGoogleChatOrganization.rs | 17 + ...integration_GetGoogleChatTargetAudience.rs | 20 + ...integration_ListGoogleChatOrganizations.rs | 15 + ...tegration_ListGoogleChatTargetAudiences.rs | 17 + ...egration_UpdateGoogleChatTargetAudience.rs | 32 + ...incident-services_CreateIncidentService.rs | 25 - ...incident-services_DeleteIncidentService.rs | 18 - ...v2_incident-services_GetIncidentService.rs | 24 - ..._incident-services_ListIncidentServices.rs | 24 - ...incident-services_UpdateIncidentService.rs | 29 - ...bservability_DeleteLLMObsPatternsConfig.rs | 18 + ...m-observability_GetLLMObsPatternsConfig.rs | 16 + ...bservability_GetLLMObsPatternsRunStatus.rs | 18 + ...ility_ListLLMObsPatternsClusteredPoints.rs | 22 + ...observability_ListLLMObsPatternsConfigs.rs | 16 + ...lm-observability_ListLLMObsPatternsRuns.rs | 18 + ...-observability_ListLLMObsPatternsTopics.rs | 22 + ...LLMObsPatternsTopicsWithClusteredPoints.rs | 23 + ...llm-observability_TriggerLLMObsPatterns.rs | 26 + ...bservability_UpsertLLMObsPatternsConfig.rs | 36 + ...ms-integration_DeleteMSTeamsUserBinding.rs | 17 + examples/v2_organizations_ListGlobalOrgs.rs | 21 + ..._organizations_ListGlobalOrgs_465966063.rs | 24 + ...UpdateLoginOrgConfigsMaxSessionDuration.rs | 25 + ...s-hardcoded_GetHardcodedRetentionFilter.rs | 20 - ...hardcoded_ListHardcodedRetentionFilters.rs | 17 - ...ardcoded_UpdateHardcodedRetentionFilter.rs | 36 - ...onitoring_RestoreSecurityMonitoringRule.rs | 20 + ...slack-integration_ListSlackUserBindings.rs | 20 + examples/v2_tag-policies_CreateTagPolicy.rs | 36 + examples/v2_tag-policies_DeleteTagPolicy.rs | 22 + examples/v2_tag-policies_GetTagPolicy.rs | 22 + examples/v2_tag-policies_GetTagPolicyScore.rs | 22 + examples/v2_tag-policies_ListTagPolicies.rs | 19 + examples/v2_tag-policies_UpdateTagPolicy.rs | 28 + src/datadog/configuration.rs | 35 +- .../api/api_cloud_cost_management.rs | 12 + src/datadogV2/api/api_data_observability.rs | 344 + .../api/api_google_chat_integration.rs | 1392 +++- src/datadogV2/api/api_llm_observability.rs | 2035 +++++- .../api/api_microsoft_teams_integration.rs | 99 + src/datadogV2/api/api_organizations.rs | 344 + .../api_rum_retention_filters_hardcoded.rs | 508 -- src/datadogV2/api/api_security_monitoring.rs | 135 + src/datadogV2/api/api_slack_integration.rs | 203 + ...cident_services.rs => api_tag_policies.rs} | 561 +- src/datadogV2/api/mod.rs | 5 +- src/datadogV2/mod.rs | 5 +- src/datadogV2/model/mod.rs | 290 +- ..._data_observability_monitor_run_status.rs} | 38 +- ...el_data_observability_monitor_run_type.rs} | 14 +- ...servability_monitor_run_status_response.rs | 96 + ..._monitor_run_status_response_attributes.rs | 121 + ...bility_monitor_run_status_response_data.rs | 127 + src/datadogV2/model/model_global_org.rs | 138 + .../model/model_global_org_attributes.rs | 137 + src/datadogV2/model/model_global_org_data.rs | 115 + ...eta_source.rs => model_global_org_type.rs} | 20 +- src/datadogV2/model/model_global_org_user.rs | 102 + .../model/model_global_orgs_links.rs | 133 + ...ttributes.rs => model_global_orgs_meta.rs} | 53 +- .../model/model_global_orgs_meta_page.rs | 185 + .../model/model_global_orgs_meta_page_type.rs | 48 + ...ponse.rs => model_global_orgs_response.rs} | 64 +- ..._google_chat_delegated_user_attributes.rs} | 85 +- ... model_google_chat_delegated_user_data.rs} | 66 +- ...del_google_chat_delegated_user_response.rs | 94 + .../model_google_chat_delegated_user_type.rs | 48 + ...el_google_chat_organization_attributes.rs} | 65 +- ...=> model_google_chat_organization_data.rs} | 65 +- ...google_chat_organization_relationships.rs} | 52 +- ...anization_relationships_delegated_user.rs} | 32 +- ...ation_relationships_delegated_user_data.rs | 130 + ...model_google_chat_organization_response.rs | 94 + .../model_google_chat_organization_type.rs | 48 + ...odel_google_chat_organizations_response.rs | 95 + ..._google_chat_target_audience_attributes.rs | 106 + ...le_chat_target_audience_create_request.rs} | 30 +- ...rget_audience_create_request_attributes.rs | 109 + ...hat_target_audience_create_request_data.rs | 115 + ...model_google_chat_target_audience_data.rs} | 81 +- ...el_google_chat_target_audience_response.rs | 94 + .../model_google_chat_target_audience_type.rs | 48 + ...gle_chat_target_audience_update_request.rs | 96 + ...get_audience_update_request_attributes.rs} | 64 +- ...hat_target_audience_update_request_data.rs | 115 + ...l_google_chat_target_audiences_response.rs | 95 + .../model_incident_service_included_items.rs | 32 - ...odel_llm_obs_patterns_activity_progress.rs | 120 + .../model_llm_obs_patterns_clustered_point.rs | 175 + ...el_llm_obs_patterns_clustered_point_ref.rs | 221 + ..._obs_patterns_clustered_points_response.rs | 96 + ...ns_clustered_points_response_attributes.rs | 120 + ...atterns_clustered_points_response_data.rs} | 43 +- ..._llm_obs_patterns_clustered_points_type.rs | 48 + ...odel_llm_obs_patterns_config_attributes.rs | 250 + .../model_llm_obs_patterns_config_item.rs | 261 + .../model_llm_obs_patterns_config_response.rs | 95 + ...l_llm_obs_patterns_config_response_data.rs | 126 + .../model_llm_obs_patterns_config_snapshot.rs | 211 + .../model_llm_obs_patterns_config_type.rs | 48 + ..._llm_obs_patterns_config_upsert_request.rs | 96 + ...tterns_config_upsert_request_attributes.rs | 247 + ...obs_patterns_config_upsert_request_data.rs | 115 + ...odel_llm_obs_patterns_configs_list_type.rs | 50 + ...model_llm_obs_patterns_configs_response.rs | 95 + ...bs_patterns_configs_response_attributes.rs | 95 + ..._llm_obs_patterns_configs_response_data.rs | 127 + .../model_llm_obs_patterns_request_type.rs | 48 + ...el_llm_obs_patterns_run_status_response.rs | 95 + ...patterns_run_status_response_attributes.rs | 129 + ...m_obs_patterns_run_status_response_data.rs | 126 + .../model_llm_obs_patterns_run_status_type.rs | 48 + .../model_llm_obs_patterns_run_summary.rs | 158 + .../model_llm_obs_patterns_runs_list_type.rs | 50 + .../model_llm_obs_patterns_runs_response.rs | 95 + ...m_obs_patterns_runs_response_attributes.rs | 94 + ...del_llm_obs_patterns_runs_response_data.rs | 126 + .../model/model_llm_obs_patterns_topic.rs | 205 + ...bs_patterns_topic_with_clustered_points.rs | 229 + .../model_llm_obs_patterns_topics_response.rs | 95 + ...obs_patterns_topics_response_attributes.rs | 182 + ...l_llm_obs_patterns_topics_response_data.rs | 126 + .../model_llm_obs_patterns_topics_type.rs | 48 + ...s_topics_with_clustered_points_response.rs | 97 + ...th_clustered_points_response_attributes.rs | 185 + ...ics_with_clustered_points_response_data.rs | 127 + ...terns_topics_with_clustered_points_type.rs | 52 + .../model_llm_obs_patterns_trigger_request.rs | 95 + ...obs_patterns_trigger_request_attributes.rs | 92 + ...l_llm_obs_patterns_trigger_request_data.rs | 115 + ...model_llm_obs_patterns_trigger_response.rs | 95 + ...bs_patterns_trigger_response_attributes.rs | 116 + ..._llm_obs_patterns_trigger_response_data.rs | 127 + ..._llm_obs_patterns_trigger_response_type.rs | 48 + .../model/model_max_session_duration_type.rs | 48 + ..._max_session_duration_update_attributes.rs | 94 + .../model_max_session_duration_update_data.rs | 115 + ...del_max_session_duration_update_request.rs | 94 + ...vability_pipeline_config_processor_item.rs | 11 + ..._pipeline_generate_metrics_v2_processor.rs | 187 + ...line_generate_metrics_v2_processor_type.rs | 48 + ...el_rum_hardcoded_cross_product_sampling.rs | 160 - ...hardcoded_cross_product_sampling_update.rs | 163 - ...m_hardcoded_retention_filter_attributes.rs | 234 - ...del_rum_hardcoded_retention_filter_meta.rs | 153 - ...un_data_observability_monitor_response.rs} | 50 +- ...ata_observability_monitor_response_data.rs | 114 + .../model/model_slack_user_binding_data.rs | 130 + ...pe.rs => model_slack_user_binding_type.rs} | 14 +- ... => model_slack_user_bindings_response.rs} | 30 +- ...rs => model_tag_policies_list_response.rs} | 43 +- .../model/model_tag_policy_attributes.rs | 304 + .../model_tag_policy_create_attributes.rs | 227 + .../model/model_tag_policy_create_data.rs | 114 + ....rs => model_tag_policy_create_request.rs} | 30 +- .../model/model_tag_policy_create_type.rs | 48 + ...ponse_data.rs => model_tag_policy_data.rs} | 71 +- .../model/model_tag_policy_include.rs | 48 + .../model/model_tag_policy_relationships.rs | 105 + .../model/model_tag_policy_resource_type.rs | 48 + .../model/model_tag_policy_response.rs | 109 + .../model_tag_policy_score_attributes.rs | 132 + .../model/model_tag_policy_score_data.rs | 125 + .../model_tag_policy_score_relationship.rs | 95 + ...odel_tag_policy_score_relationship_data.rs | 113 + .../model_tag_policy_score_resource_type.rs | 48 + ....rs => model_tag_policy_score_response.rs} | 40 +- .../model/model_tag_policy_source.rs | 60 + src/datadogV2/model/model_tag_policy_type.rs | 51 + .../model_tag_policy_update_attributes.rs | 239 + .../model/model_tag_policy_update_data.rs | 132 + .../model/model_tag_policy_update_request.rs | 92 + ...nt-service-returns-CREATED-response.frozen | 1 - ...dent-service-returns-CREATED-response.json | 63 - ...ncident-service-returns-OK-response.frozen | 1 - ...-incident-service-returns-OK-response.json | 87 - ...cident-services-returns-OK-response.frozen | 1 - ...incident-services-returns-OK-response.json | 91 - ...ncident-service-returns-OK-response.frozen | 1 - ...-incident-service-returns-OK-response.json | 91 - ...ncident-service-returns-OK-response.frozen | 1 - ...-incident-service-returns-OK-response.json | 97 - ...l-version-returns-Conflict-response.frozen | 1 + ...cal-version-returns-Conflict-response.json | 125 + ...-version-returns-Not-Found-response.frozen | 1 + ...al-version-returns-Not-Found-response.json | 91 + ...torical-version-returns-OK-response.frozen | 1 + ...istorical-version-returns-OK-response.json | 125 + tests/scenarios/features/v2/given.json | 44 +- .../v2/google_chat_integration.feature | 167 + .../features/v2/incident_services.feature | 146 - .../features/v2/llm_observability.feature | 227 + .../v2/microsoft_teams_integration.feature | 21 + .../features/v2/organizations.feature | 35 + .../rum_hardcoded_retention_filters.feature | 59 - .../rum_retention_filters_hardcoded.feature | 59 - .../features/v2/security_monitoring.feature | 42 + .../features/v2/slack_integration.feature | 23 + .../features/v2/tag_policies.feature | 150 + tests/scenarios/features/v2/undo.json | 262 +- tests/scenarios/function_mappings.rs | 2282 +++++-- 208 files changed, 24382 insertions(+), 5178 deletions(-) create mode 100644 examples/v2_google-chat-integration_CreateGoogleChatTargetAudience.rs create mode 100644 examples/v2_google-chat-integration_DeleteGoogleChatDelegatedUser.rs create mode 100644 examples/v2_google-chat-integration_DeleteGoogleChatOrganization.rs create mode 100644 examples/v2_google-chat-integration_DeleteGoogleChatTargetAudience.rs create mode 100644 examples/v2_google-chat-integration_GetGoogleChatDelegatedUser.rs create mode 100644 examples/v2_google-chat-integration_GetGoogleChatOrganization.rs create mode 100644 examples/v2_google-chat-integration_GetGoogleChatTargetAudience.rs create mode 100644 examples/v2_google-chat-integration_ListGoogleChatOrganizations.rs create mode 100644 examples/v2_google-chat-integration_ListGoogleChatTargetAudiences.rs create mode 100644 examples/v2_google-chat-integration_UpdateGoogleChatTargetAudience.rs delete mode 100644 examples/v2_incident-services_CreateIncidentService.rs delete mode 100644 examples/v2_incident-services_DeleteIncidentService.rs delete mode 100644 examples/v2_incident-services_GetIncidentService.rs delete mode 100644 examples/v2_incident-services_ListIncidentServices.rs delete mode 100644 examples/v2_incident-services_UpdateIncidentService.rs create mode 100644 examples/v2_llm-observability_DeleteLLMObsPatternsConfig.rs create mode 100644 examples/v2_llm-observability_GetLLMObsPatternsConfig.rs create mode 100644 examples/v2_llm-observability_GetLLMObsPatternsRunStatus.rs create mode 100644 examples/v2_llm-observability_ListLLMObsPatternsClusteredPoints.rs create mode 100644 examples/v2_llm-observability_ListLLMObsPatternsConfigs.rs create mode 100644 examples/v2_llm-observability_ListLLMObsPatternsRuns.rs create mode 100644 examples/v2_llm-observability_ListLLMObsPatternsTopics.rs create mode 100644 examples/v2_llm-observability_ListLLMObsPatternsTopicsWithClusteredPoints.rs create mode 100644 examples/v2_llm-observability_TriggerLLMObsPatterns.rs create mode 100644 examples/v2_llm-observability_UpsertLLMObsPatternsConfig.rs create mode 100644 examples/v2_microsoft-teams-integration_DeleteMSTeamsUserBinding.rs create mode 100644 examples/v2_organizations_ListGlobalOrgs.rs create mode 100644 examples/v2_organizations_ListGlobalOrgs_465966063.rs create mode 100644 examples/v2_organizations_UpdateLoginOrgConfigsMaxSessionDuration.rs delete mode 100644 examples/v2_rum-retention-filters-hardcoded_GetHardcodedRetentionFilter.rs delete mode 100644 examples/v2_rum-retention-filters-hardcoded_ListHardcodedRetentionFilters.rs delete mode 100644 examples/v2_rum-retention-filters-hardcoded_UpdateHardcodedRetentionFilter.rs create mode 100644 examples/v2_security-monitoring_RestoreSecurityMonitoringRule.rs create mode 100644 examples/v2_slack-integration_ListSlackUserBindings.rs create mode 100644 examples/v2_tag-policies_CreateTagPolicy.rs create mode 100644 examples/v2_tag-policies_DeleteTagPolicy.rs create mode 100644 examples/v2_tag-policies_GetTagPolicy.rs create mode 100644 examples/v2_tag-policies_GetTagPolicyScore.rs create mode 100644 examples/v2_tag-policies_ListTagPolicies.rs create mode 100644 examples/v2_tag-policies_UpdateTagPolicy.rs create mode 100644 src/datadogV2/api/api_data_observability.rs delete mode 100644 src/datadogV2/api/api_rum_retention_filters_hardcoded.rs create mode 100644 src/datadogV2/api/api_slack_integration.rs rename src/datadogV2/api/{api_incident_services.rs => api_tag_policies.rs} (55%) rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_event_type.rs => model_data_observability_monitor_run_status.rs} (60%) rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_type.rs => model_data_observability_monitor_run_type.rs} (74%) create mode 100644 src/datadogV2/model/model_get_data_observability_monitor_run_status_response.rs create mode 100644 src/datadogV2/model/model_get_data_observability_monitor_run_status_response_attributes.rs create mode 100644 src/datadogV2/model/model_get_data_observability_monitor_run_status_response_data.rs create mode 100644 src/datadogV2/model/model_global_org.rs create mode 100644 src/datadogV2/model/model_global_org_attributes.rs create mode 100644 src/datadogV2/model/model_global_org_data.rs rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_meta_source.rs => model_global_org_type.rs} (68%) create mode 100644 src/datadogV2/model/model_global_org_user.rs create mode 100644 src/datadogV2/model/model_global_orgs_links.rs rename src/datadogV2/model/{model_incident_service_update_attributes.rs => model_global_orgs_meta.rs} (66%) create mode 100644 src/datadogV2/model/model_global_orgs_meta_page.rs create mode 100644 src/datadogV2/model/model_global_orgs_meta_page_type.rs rename src/datadogV2/model/{model_incident_services_response.rs => model_global_orgs_response.rs} (63%) rename src/datadogV2/model/{model_incident_service_response_attributes.rs => model_google_chat_delegated_user_attributes.rs} (56%) rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_data.rs => model_google_chat_delegated_user_data.rs} (63%) create mode 100644 src/datadogV2/model/model_google_chat_delegated_user_response.rs create mode 100644 src/datadogV2/model/model_google_chat_delegated_user_type.rs rename src/datadogV2/model/{model_incident_service_relationships.rs => model_google_chat_organization_attributes.rs} (59%) rename src/datadogV2/model/{model_incident_service_update_data.rs => model_google_chat_organization_data.rs} (69%) rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_update_attributes.rs => model_google_chat_organization_relationships.rs} (58%) rename src/datadogV2/model/{model_rum_hardcoded_retention_filters_response.rs => model_google_chat_organization_relationships_delegated_user.rs} (70%) create mode 100644 src/datadogV2/model/model_google_chat_organization_relationships_delegated_user_data.rs create mode 100644 src/datadogV2/model/model_google_chat_organization_response.rs create mode 100644 src/datadogV2/model/model_google_chat_organization_type.rs create mode 100644 src/datadogV2/model/model_google_chat_organizations_response.rs create mode 100644 src/datadogV2/model/model_google_chat_target_audience_attributes.rs rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_update_request.rs => model_google_chat_target_audience_create_request.rs} (72%) create mode 100644 src/datadogV2/model/model_google_chat_target_audience_create_request_attributes.rs create mode 100644 src/datadogV2/model/model_google_chat_target_audience_create_request_data.rs rename src/datadogV2/model/{model_incident_service_create_data.rs => model_google_chat_target_audience_data.rs} (62%) create mode 100644 src/datadogV2/model/model_google_chat_target_audience_response.rs create mode 100644 src/datadogV2/model/model_google_chat_target_audience_type.rs create mode 100644 src/datadogV2/model/model_google_chat_target_audience_update_request.rs rename src/datadogV2/model/{model_rum_hardcoded_cross_product_sampling_editability.rs => model_google_chat_target_audience_update_request_attributes.rs} (58%) create mode 100644 src/datadogV2/model/model_google_chat_target_audience_update_request_data.rs create mode 100644 src/datadogV2/model/model_google_chat_target_audiences_response.rs delete mode 100644 src/datadogV2/model/model_incident_service_included_items.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_activity_progress.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_clustered_point.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_clustered_point_ref.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_clustered_points_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_attributes.rs rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_update_data.rs => model_llm_obs_patterns_clustered_points_response_data.rs} (68%) create mode 100644 src/datadogV2/model/model_llm_obs_patterns_clustered_points_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_item.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_snapshot.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_upsert_request.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_configs_list_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_configs_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_configs_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_configs_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_request_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_run_status_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_run_status_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_run_status_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_run_status_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_run_summary.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_runs_list_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_runs_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_runs_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_runs_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topic.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topic_with_clustered_points.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_type.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_request.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_request_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_request_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_response.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_response_attributes.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_response_data.rs create mode 100644 src/datadogV2/model/model_llm_obs_patterns_trigger_response_type.rs create mode 100644 src/datadogV2/model/model_max_session_duration_type.rs create mode 100644 src/datadogV2/model/model_max_session_duration_update_attributes.rs create mode 100644 src/datadogV2/model/model_max_session_duration_update_data.rs create mode 100644 src/datadogV2/model/model_max_session_duration_update_request.rs create mode 100644 src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor.rs create mode 100644 src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor_type.rs delete mode 100644 src/datadogV2/model/model_rum_hardcoded_cross_product_sampling.rs delete mode 100644 src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_update.rs delete mode 100644 src/datadogV2/model/model_rum_hardcoded_retention_filter_attributes.rs delete mode 100644 src/datadogV2/model/model_rum_hardcoded_retention_filter_meta.rs rename src/datadogV2/model/{model_rum_hardcoded_retention_filter_response.rs => model_run_data_observability_monitor_response.rs} (65%) create mode 100644 src/datadogV2/model/model_run_data_observability_monitor_response_data.rs create mode 100644 src/datadogV2/model/model_slack_user_binding_data.rs rename src/datadogV2/model/{model_incident_service_type.rs => model_slack_user_binding_type.rs} (81%) rename src/datadogV2/model/{model_incident_service_update_request.rs => model_slack_user_bindings_response.rs} (74%) rename src/datadogV2/model/{model_incident_service_response.rs => model_tag_policies_list_response.rs} (70%) create mode 100644 src/datadogV2/model/model_tag_policy_attributes.rs create mode 100644 src/datadogV2/model/model_tag_policy_create_attributes.rs create mode 100644 src/datadogV2/model/model_tag_policy_create_data.rs rename src/datadogV2/model/{model_incident_service_create_request.rs => model_tag_policy_create_request.rs} (73%) create mode 100644 src/datadogV2/model/model_tag_policy_create_type.rs rename src/datadogV2/model/{model_incident_service_response_data.rs => model_tag_policy_data.rs} (66%) create mode 100644 src/datadogV2/model/model_tag_policy_include.rs create mode 100644 src/datadogV2/model/model_tag_policy_relationships.rs create mode 100644 src/datadogV2/model/model_tag_policy_resource_type.rs create mode 100644 src/datadogV2/model/model_tag_policy_response.rs create mode 100644 src/datadogV2/model/model_tag_policy_score_attributes.rs create mode 100644 src/datadogV2/model/model_tag_policy_score_data.rs create mode 100644 src/datadogV2/model/model_tag_policy_score_relationship.rs create mode 100644 src/datadogV2/model/model_tag_policy_score_relationship_data.rs create mode 100644 src/datadogV2/model/model_tag_policy_score_resource_type.rs rename src/datadogV2/model/{model_incident_service_create_attributes.rs => model_tag_policy_score_response.rs} (68%) create mode 100644 src/datadogV2/model/model_tag_policy_source.rs create mode 100644 src/datadogV2/model/model_tag_policy_type.rs create mode 100644 src/datadogV2/model/model_tag_policy_update_attributes.rs create mode 100644 src/datadogV2/model/model_tag_policy_update_data.rs create mode 100644 src/datadogV2/model/model_tag_policy_update_request.rs delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.json delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.json delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.json delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.json delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen delete mode 100644 tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.json create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.json create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.json create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen create mode 100644 tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.json delete mode 100644 tests/scenarios/features/v2/incident_services.feature delete mode 100644 tests/scenarios/features/v2/rum_hardcoded_retention_filters.feature delete mode 100644 tests/scenarios/features/v2/rum_retention_filters_hardcoded.feature create mode 100644 tests/scenarios/features/v2/slack_integration.feature create mode 100644 tests/scenarios/features/v2/tag_policies.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6c36643fc4..48ab737deb 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -668,6 +668,13 @@ components: required: true schema: type: string + GoogleChatTargetAudienceIdPathParameter: + description: Your target audience ID. + in: path + name: target_audience_id + required: true + schema: + type: string HistoricalJobID: description: The ID of the job. in: path @@ -807,28 +814,6 @@ components: required: false schema: $ref: "#/components/schemas/IncidentSearchSortOrder" - IncidentServiceIDPathParameter: - description: The ID of the incident service. - in: path - name: service_id - required: true - schema: - type: string - IncidentServiceIncludeQueryParameter: - description: Specifies which types of related objects should be included in the response. - in: query - name: "include" - required: false - schema: - $ref: "#/components/schemas/IncidentRelatedObject" - IncidentServiceSearchQueryParameter: - description: A search query that filters services by name. - in: query - name: "filter" - required: false - schema: - example: "ExampleServiceName" - type: string IncidentTodoIDPathParameter: description: The UUID of the incident todo. in: path @@ -937,6 +922,58 @@ components: required: true schema: $ref: "#/components/schemas/LLMObsIntegrationName" + LLMObsPatternsConfigIDPathParameter: + description: The ID of the patterns configuration. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + in: path + name: config_id + required: true + schema: + type: string + LLMObsPatternsConfigIDQueryParameter: + description: The ID of the patterns configuration. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + in: query + name: config_id + required: true + schema: + type: string + LLMObsPatternsIncludeMetricsQueryParameter: + description: |- + When true, enrich each clustered point with span metrics such as status, + duration, token counts, estimated cost, and evaluations. + in: query + name: include_metrics + schema: + type: boolean + LLMObsPatternsPageSizeQueryParameter: + description: Maximum number of clustered points to return per page. + in: query + name: page_size + schema: + format: int64 + type: integer + LLMObsPatternsPageTokenQueryParameter: + description: Pagination token to retrieve the next page of clustered points. + in: query + name: page_token + schema: + type: string + LLMObsPatternsRunIDQueryParameter: + description: The ID of a specific patterns run. Defaults to the most recent completed run. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + in: query + name: run_id + schema: + type: string + LLMObsPatternsTopicIDQueryParameter: + description: The ID of the topic to retrieve clustered points for. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + in: query + name: topic_id + required: true + schema: + type: string LLMObsProjectIDPathParameter: description: The ID of the LLM Observability project. example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" @@ -1012,6 +1049,13 @@ components: required: true schema: type: string + MicrosoftTeamsTenantIDPathParameter: + description: Your tenant id. + in: path + name: tenant_id + required: true + schema: + type: string MicrosoftTeamsTenantIDQueryParameter: description: Your tenant id. in: query @@ -1565,20 +1609,6 @@ components: required: true schema: type: string - RumHardcodedRetentionFilterApplicationIDParameter: - description: RUM application ID. - in: path - name: app_id - required: true - schema: - type: string - RumHardcodedRetentionFilterIDParameter: - description: Hardcoded retention filter ID. - in: path - name: rf_id - required: true - schema: - type: string RumMetricIDParameter: description: The name of the RUM-based metric. in: path @@ -1707,6 +1737,15 @@ components: required: true schema: type: string + SecurityMonitoringRuleVersion: + description: The historical version number of the rule. + in: path + name: version + required: true + schema: + example: 1 + format: int64 + type: integer SecurityMonitoringSuppressionID: description: The ID of the suppression rule in: path @@ -1780,6 +1819,14 @@ components: required: false schema: type: boolean + SlackUserUuidQueryParameter: + description: The UUID of the Datadog user to list Slack bindings for. + in: query + name: user_uuid + required: true + schema: + format: uuid + type: string SloID: description: The ID of the SLO. in: path @@ -28735,6 +28782,31 @@ components: - bucket_name - bucket_region type: object + DataObservabilityMonitorRunStatus: + description: The status of a data observability monitor run. + enum: + - pending + - ok + - warn + - alert + - error + example: pending + type: string + x-enum-varnames: + - PENDING + - OK + - WARN + - ALERT + - ERROR + DataObservabilityMonitorRunType: + default: monitor_run + description: The JSON:API resource type for a data observability monitor run. + enum: + - monitor_run + example: monitor_run + type: string + x-enum-varnames: + - MONITOR_RUN DataRelationshipsTeams: description: Associates teams with this schedule in a data structure. properties: @@ -39045,6 +39117,42 @@ components: meta: $ref: "#/components/schemas/DataDeletionResponseMeta" type: object + GetDataObservabilityMonitorRunStatusResponse: + description: The response for getting the status of a data observability monitor run. + properties: + data: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseData" + required: + - data + type: object + GetDataObservabilityMonitorRunStatusResponseAttributes: + description: The attributes of a data observability monitor run status response. + properties: + error_message: + description: Error message describing why the monitor run failed. Only present when status is error. + example: "run completed but produced no metric data" + type: string + status: + $ref: "#/components/schemas/DataObservabilityMonitorRunStatus" + required: + - status + type: object + GetDataObservabilityMonitorRunStatusResponseData: + description: The data object for a data observability monitor run status response. + properties: + attributes: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponseAttributes" + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + - attributes + type: object GetDeviceAttributes: description: The device attributes properties: @@ -39913,6 +40021,64 @@ components: type: string x-enum-varnames: - INCIDENTS_GLOBAL_SETTINGS + GlobalOrg: + description: Organization information for a global organization association. + properties: + name: + description: The name of the organization. + example: Example Org + type: string + public_id: + description: The public identifier of the organization. + example: abcdef12345 + nullable: true + type: string + subdomain: + description: The subdomain used to access the organization, if configured. + example: example + nullable: true + type: string + uuid: + description: The UUID of the organization. + example: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + format: uuid + type: string + required: + - uuid + - name + type: object + GlobalOrgAttributes: + description: Attributes of an organization associated with the authenticated user. + properties: + org: + $ref: "#/components/schemas/GlobalOrg" + redirect_url: + description: The login URL used to switch into the organization, if available. + example: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + nullable: true + type: string + source_region: + description: The source region of the organization. + example: us1.prod.dog + type: string + user: + $ref: "#/components/schemas/GlobalOrgUser" + required: + - user + - org + - source_region + type: object + GlobalOrgData: + description: An organization associated with the authenticated user. + properties: + attributes: + $ref: "#/components/schemas/GlobalOrgAttributes" + type: + $ref: "#/components/schemas/GlobalOrgType" + required: + - type + - attributes + type: object GlobalOrgIdentifier: description: A unique identifier for an organization including its site. properties: @@ -39929,6 +40095,99 @@ components: - org_uuid - org_site type: object + GlobalOrgType: + description: The resource type for global user organizations. + enum: [global_user_orgs] + example: global_user_orgs + type: string + x-enum-varnames: + - GLOBAL_USER_ORGS + GlobalOrgUser: + description: User information for a global organization association. + properties: + handle: + description: The handle of the user. + example: user@example.com + type: string + uuid: + description: The UUID of the user. + example: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + format: uuid + type: string + required: + - uuid + - handle + type: object + GlobalOrgsLinks: + description: Pagination links. + properties: + next: + description: Link to the next page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + nullable: true + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + type: string + type: object + GlobalOrgsMeta: + description: Response metadata object. + properties: + page: + $ref: "#/components/schemas/GlobalOrgsMetaPage" + type: object + GlobalOrgsMetaPage: + description: Paging attributes. + properties: + cursor: + description: The cursor used to get the current results, if any. + example: "" + type: string + limit: + description: Number of results returned. + example: 100 + format: int32 + maximum: 1000 + type: integer + next_cursor: + description: The cursor used to get the next results, if any. + example: next-page + nullable: true + type: string + prev_cursor: + description: The cursor used to get the previous results, if any. + nullable: true + type: string + type: + $ref: "#/components/schemas/GlobalOrgsMetaPageType" + type: object + GlobalOrgsMetaPageType: + description: Type of global orgs pagination. + enum: [cursor] + example: cursor + type: string + x-enum-varnames: + - CURSOR + GlobalOrgsResponse: + description: Response containing organizations across regions for the authenticated user. + properties: + data: + description: Organizations across regions for the authenticated user. + items: + $ref: "#/components/schemas/GlobalOrgData" + type: array + links: + $ref: "#/components/schemas/GlobalOrgsLinks" + meta: + $ref: "#/components/schemas/GlobalOrgsMeta" + required: + - data + type: object GlobalVariableData: description: Synthetics global variable data. Wrapper around the global variable object. properties: @@ -40076,6 +40335,84 @@ components: required: - attributes type: object + GoogleChatDelegatedUserAttributes: + description: Google Chat delegated user attributes. + properties: + display_name: + description: The delegated user's display name. + example: "fake-display-name" + type: string + email: + description: The delegated user's email address. + example: "user@example.com" + type: string + features: + description: The list of features enabled for the delegated user. + items: + type: string + type: array + type: object + GoogleChatDelegatedUserData: + description: Google Chat delegated user data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatDelegatedUserAttributes" + id: + description: The ID of the delegated user. + example: "2b3c4d5e-6f78-9012-bcde-f23456789012" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/GoogleChatDelegatedUserType" + type: object + GoogleChatDelegatedUserResponse: + description: Response containing a Google Chat delegated user. + properties: + data: + $ref: "#/components/schemas/GoogleChatDelegatedUserData" + required: + - data + type: object + GoogleChatDelegatedUserType: + default: google-chat-delegated-user + description: Google Chat delegated user resource type. + enum: + - google-chat-delegated-user + example: google-chat-delegated-user + type: string + x-enum-varnames: + - GOOGLE_CHAT_DELEGATED_USER_TYPE + GoogleChatOrganizationAttributes: + description: Google Chat organization attributes. + properties: + domain_id: + description: The Google Chat organization domain ID. + example: "fake-domain-id" + maxLength: 255 + type: string + domain_name: + description: The Google Chat organization domain name. + example: "example.com" + maxLength: 255 + type: string + type: object + GoogleChatOrganizationData: + description: Google Chat organization data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatOrganizationAttributes" + id: + description: The ID of the Google Chat organization binding. + example: "5ce87709-a12f-4086-fcc8-147045b73a19" + maxLength: 100 + minLength: 1 + type: string + relationships: + $ref: "#/components/schemas/GoogleChatOrganizationRelationships" + type: + $ref: "#/components/schemas/GoogleChatOrganizationType" + type: object GoogleChatOrganizationHandleResponse: description: Organization handle for monitor notifications to a Google Chat space within a Google organization. properties: @@ -40138,6 +40475,184 @@ components: required: - data type: object + GoogleChatOrganizationRelationships: + description: Google Chat organization relationships. + properties: + delegated_user: + $ref: "#/components/schemas/GoogleChatOrganizationRelationshipsDelegatedUser" + type: object + GoogleChatOrganizationRelationshipsDelegatedUser: + description: The delegated user relationship. + properties: + data: + $ref: "#/components/schemas/GoogleChatOrganizationRelationshipsDelegatedUserData" + type: object + GoogleChatOrganizationRelationshipsDelegatedUserData: + description: Delegated user relationship data. + properties: + id: + description: The ID of the delegated user. + example: "2b3c4d5e-6f78-9012-bcde-f23456789012" + type: string + type: + $ref: "#/components/schemas/GoogleChatDelegatedUserType" + type: object + GoogleChatOrganizationResponse: + description: Response containing a Google Chat organization binding. + properties: + data: + $ref: "#/components/schemas/GoogleChatOrganizationData" + required: + - data + type: object + GoogleChatOrganizationType: + default: google-chat-organization + description: Google Chat organization resource type. + enum: + - google-chat-organization + example: google-chat-organization + type: string + x-enum-varnames: + - GOOGLE_CHAT_ORGANIZATION_TYPE + GoogleChatOrganizationsResponse: + description: Response containing a list of Google Chat organization bindings. + properties: + data: + description: An array of Google Chat organization bindings. + items: + $ref: "#/components/schemas/GoogleChatOrganizationData" + type: array + required: + - data + type: object + GoogleChatTargetAudienceAttributes: + description: Google Chat target audience attributes. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + required: + - audience_name + - audience_id + type: object + GoogleChatTargetAudienceCreateRequest: + description: Create target audience request. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequestData" + required: + - data + type: object + GoogleChatTargetAudienceCreateRequestAttributes: + description: Attributes for creating a Google Chat target audience. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + required: + - audience_name + - audience_id + type: object + GoogleChatTargetAudienceCreateRequestData: + description: Data for a create target audience request. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequestAttributes" + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + required: + - type + - attributes + type: object + GoogleChatTargetAudienceData: + description: Google Chat target audience data from a response. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceAttributes" + id: + description: The ID of the target audience. + example: "1f3e5ce6-944a-4075-97ae-105b5920b5cb" + maxLength: 100 + minLength: 1 + type: string + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + type: object + GoogleChatTargetAudienceResponse: + description: Response containing a Google Chat target audience. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceData" + required: + - data + type: object + GoogleChatTargetAudienceType: + default: google-chat-target-audience + description: Google Chat target audience resource type. + enum: + - google-chat-target-audience + example: google-chat-target-audience + type: string + x-enum-varnames: + - GOOGLE_CHAT_TARGET_AUDIENCE_TYPE + GoogleChatTargetAudienceUpdateRequest: + description: Update target audience request. + properties: + data: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequestData" + required: + - data + type: object + GoogleChatTargetAudienceUpdateRequestAttributes: + description: Attributes for updating a Google Chat target audience. + properties: + audience_id: + description: The audience ID. + example: "fake-audience-id-1" + maxLength: 255 + type: string + audience_name: + description: The audience name. + example: "fake audience name 1" + maxLength: 255 + type: string + type: object + GoogleChatTargetAudienceUpdateRequestData: + description: Data for an update target audience request. + properties: + attributes: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequestAttributes" + type: + $ref: "#/components/schemas/GoogleChatTargetAudienceType" + required: + - type + - attributes + type: object + GoogleChatTargetAudiencesResponse: + description: Response containing a list of Google Chat target audiences. + properties: + data: + description: An array of Google Chat target audiences. + items: + $ref: "#/components/schemas/GoogleChatTargetAudienceData" + type: array + required: + - data + type: object GoogleChatUpdateOrganizationHandleRequest: description: Update organization handle request. properties: @@ -43221,161 +43736,6 @@ components: x-enum-varnames: - CREATED_ASCENDING - CREATED_DESCENDING - IncidentServiceCreateAttributes: - description: The incident service's attributes for a create request. - properties: - name: - description: Name of the incident service. - example: "an example service name" - type: string - required: - - name - type: object - IncidentServiceCreateData: - description: Incident Service payload for create requests. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceCreateAttributes" - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - type - type: object - IncidentServiceCreateRequest: - description: Create request with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceCreateData" - required: - - data - type: object - IncidentServiceIncludedItems: - description: An object related to an incident service which is present in the included payload. - oneOf: - - $ref: "#/components/schemas/User" - IncidentServiceRelationships: - description: The incident service's relationships. - properties: - created_by: - $ref: "#/components/schemas/RelationshipToUser" - last_modified_by: - $ref: "#/components/schemas/RelationshipToUser" - readOnly: true - type: object - IncidentServiceResponse: - description: Response with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceResponseData" - included: - description: Included objects from relationships. - items: - $ref: "#/components/schemas/IncidentServiceIncludedItems" - readOnly: true - type: array - required: - - data - type: object - IncidentServiceResponseAttributes: - description: The incident service's attributes from a response. - properties: - created: - description: Timestamp of when the incident service was created. - format: date-time - readOnly: true - type: string - modified: - description: Timestamp of when the incident service was modified. - format: date-time - readOnly: true - type: string - name: - description: Name of the incident service. - example: "service name" - type: string - type: object - IncidentServiceResponseData: - description: Incident Service data from responses. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceResponseAttributes" - id: - description: The incident service's ID. - example: "00000000-0000-0000-0000-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - id - - type - type: object - IncidentServiceType: - default: services - description: Incident service resource type. - enum: - - services - example: services - type: string - x-enum-varnames: - - SERVICES - IncidentServiceUpdateAttributes: - description: The incident service's attributes for an update request. - properties: - name: - description: Name of the incident service. - example: "an example service name" - type: string - required: - - name - type: object - IncidentServiceUpdateData: - description: Incident Service payload for update requests. - properties: - attributes: - $ref: "#/components/schemas/IncidentServiceUpdateAttributes" - id: - description: The incident service's ID. - example: "00000000-0000-0000-0000-000000000000" - type: string - relationships: - $ref: "#/components/schemas/IncidentServiceRelationships" - type: - $ref: "#/components/schemas/IncidentServiceType" - required: - - type - type: object - IncidentServiceUpdateRequest: - description: Update request with an incident service payload. - properties: - data: - $ref: "#/components/schemas/IncidentServiceUpdateData" - required: - - data - type: object - IncidentServicesResponse: - description: Response with a list of incident service payloads. - properties: - data: - description: An array of incident services. - example: [{"id": "00000000-0000-0000-0000-000000000000", "type": "services"}] - items: - $ref: "#/components/schemas/IncidentServiceResponseData" - type: array - included: - description: Included related resources which the user requested. - items: - $ref: "#/components/schemas/IncidentServiceIncludedItems" - readOnly: true - type: array - meta: - $ref: "#/components/schemas/IncidentResponseMeta" - required: - - data - type: "object" IncidentSeverity: description: The incident severity. enum: @@ -51368,6 +51728,1017 @@ components: - AUTO - CONCISE - DETAILED + LLMObsPatternsActivityProgress: + description: Progress information for a single step of a patterns run. + properties: + name: + description: Name of the step. + example: generate_topics + type: string + started_at: + description: Timestamp when the step started. Null if the step has not started. + example: "2024-01-15T10:30:00Z" + format: date-time + nullable: true + type: string + status: + description: Status of the step. + example: completed + type: string + required: + - name + - status + type: object + LLMObsPatternsClusteredPoint: + description: A single data point grouped into a topic. + properties: + event_id: + description: Identifier of the source event. + example: "AAAAAYabc123" + type: string + id: + description: Unique identifier of the clustered point. + example: "9b0c1d2e-3f40-5a61-b728-c9d0e1f2a3b4" + type: string + input: + description: Input text of the source span. + example: "How do I get a refund?" + type: string + is_included: + description: Whether the point is included in the patterns dataset. + example: false + type: boolean + is_suggested: + description: Whether the point is suggested for inclusion in the patterns dataset. + example: true + type: boolean + session_id: + description: Identifier of the source session. + example: "session-7c3f5a1b" + type: string + span_id: + description: Identifier of the source span. + example: "1234567890123456789" + type: string + topic_id: + description: Identifier of the topic the point belongs to. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + type: string + required: + - id + - event_id + - topic_id + - span_id + - session_id + - input + - is_suggested + - is_included + type: object + LLMObsPatternsClusteredPointRef: + description: |- + A clustered point attached inline to a topic. The metric fields are populated + only when the request includes `include_metrics=true`. + properties: + duration: + description: Duration of the source span in nanoseconds. Included only when metrics are requested. + example: 1500000 + format: double + type: number + estimated_total_cost: + description: Estimated total cost of the source span. Included only when metrics are requested. + example: 0.0021 + format: double + type: number + evaluation: + additionalProperties: {} + description: |- + Evaluation results for the source span keyed by evaluation name. Included + only when metrics are requested. + type: object + input_tokens: + description: Number of input tokens of the source span. Included only when metrics are requested. + example: 128 + format: double + type: number + output_tokens: + description: Number of output tokens of the source span. Included only when metrics are requested. + example: 64 + format: double + type: number + span_id: + description: Identifier of the source span. + example: "1234567890123456789" + type: string + status: + description: Status of the source span. Included only when metrics are requested. + example: ok + type: string + total_tokens: + description: Total number of tokens of the source span. Included only when metrics are requested. + example: 192 + format: double + type: number + required: + - span_id + type: object + LLMObsPatternsClusteredPointRefsList: + description: List of clustered points attached to a topic. + items: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointRef" + type: array + LLMObsPatternsClusteredPointsList: + description: List of clustered points. + items: + $ref: "#/components/schemas/LLMObsPatternsClusteredPoint" + type: array + LLMObsPatternsClusteredPointsResponse: + description: Response containing the clustered points of an LLM Observability topic. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointsResponseData" + required: + - data + type: object + LLMObsPatternsClusteredPointsResponseAttributes: + description: Attributes of an LLM Observability patterns clustered points response. + properties: + next_page_token: + description: Pagination token for the next page of points. Null if there are no more pages. + example: "eyJvZmZzZXQiOjUwfQ==" + nullable: true + type: string + points: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointsList" + topic_id: + description: Identifier of the topic the points belong to. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + type: string + required: + - topic_id + - next_page_token + - points + type: object + LLMObsPatternsClusteredPointsResponseData: + description: Data object of an LLM Observability patterns clustered points response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointsResponseAttributes" + id: + description: Identifier of the topic the points belong to. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointsType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsClusteredPointsType: + description: Resource type of an LLM Observability patterns clustered points response. + enum: + - clustered_points_response + example: clustered_points_response + type: string + x-enum-varnames: + - CLUSTERED_POINTS_RESPONSE + LLMObsPatternsConfigAttributes: + description: Attributes of an LLM Observability patterns configuration. + properties: + account_id: + description: Integration account ID for a bring-your-own-model configuration. + example: "1000000001" + nullable: true + type: string + created_at: + description: Timestamp when the configuration was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + evp_query: + description: Query that selects the spans the patterns run analyzes. + example: "@ml_app:support-bot" + type: string + hierarchy_depth: + description: Depth of the topic hierarchy to generate. + example: 2 + format: int32 + maximum: 2147483647 + type: integer + integration_provider: + description: Integration provider for a bring-your-own-model configuration. + example: openai + nullable: true + type: string + model_name: + description: Model name for a bring-your-own-model configuration. + example: gpt-4o + nullable: true + type: string + name: + description: Name of the configuration. + example: "Support chatbot topics" + type: string + num_records: + description: Maximum number of records to process for the run. + example: 1000 + format: int32 + maximum: 2147483647 + type: integer + sampling_ratio: + description: Fraction of matching spans to sample for the run. + example: 0.1 + format: double + type: number + scope: + description: Scope of the configuration. + example: "" + type: string + template: + description: Template used to guide topic generation. + example: "" + nullable: true + type: string + updated_at: + description: Timestamp when the configuration was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + required: + - name + - evp_query + - sampling_ratio + - num_records + - hierarchy_depth + - scope + - created_at + - updated_at + type: object + LLMObsPatternsConfigItem: + description: A single LLM Observability patterns configuration in a list response. + properties: + account_id: + description: Integration account ID for a bring-your-own-model configuration. + example: "1000000001" + nullable: true + type: string + created_at: + description: Timestamp when the configuration was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + evp_query: + description: Query that selects the spans the patterns run analyzes. + example: "@ml_app:support-bot" + type: string + hierarchy_depth: + description: Depth of the topic hierarchy to generate. + example: 2 + format: int32 + maximum: 2147483647 + type: integer + id: + description: Unique identifier of the configuration. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + integration_provider: + description: Integration provider for a bring-your-own-model configuration. + example: openai + nullable: true + type: string + model_name: + description: Model name for a bring-your-own-model configuration. + example: gpt-4o + nullable: true + type: string + name: + description: Name of the configuration. + example: "Support chatbot topics" + type: string + num_records: + description: Maximum number of records to process for the run. + example: 1000 + format: int32 + maximum: 2147483647 + type: integer + sampling_ratio: + description: Fraction of matching spans to sample for the run. + example: 0.1 + format: double + type: number + scope: + description: Scope of the configuration. + example: "" + type: string + template: + description: Template used to guide topic generation. + example: "" + nullable: true + type: string + updated_at: + description: Timestamp when the configuration was last updated. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + required: + - id + - name + - evp_query + - sampling_ratio + - num_records + - hierarchy_depth + - scope + - created_at + - updated_at + type: object + LLMObsPatternsConfigItemsList: + description: List of patterns configurations. + items: + $ref: "#/components/schemas/LLMObsPatternsConfigItem" + type: array + LLMObsPatternsConfigResponse: + description: Response containing a single LLM Observability patterns configuration. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsConfigResponseData" + required: + - data + type: object + LLMObsPatternsConfigResponseData: + description: Data object of an LLM Observability patterns configuration. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsConfigAttributes" + id: + description: Unique identifier of the configuration. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsConfigType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsConfigSnapshot: + description: Snapshot of the configuration used for a patterns run. + properties: + account_id: + description: Integration account ID used for a bring-your-own-model run. + example: "1000000001" + type: string + evp_query: + description: Query that selected the spans for the run. + example: "@ml_app:support-bot" + type: string + hierarchy_depth: + description: Depth of the topic hierarchy generated. + example: 2 + format: int32 + maximum: 2147483647 + type: integer + integration_provider: + description: Integration provider used for a bring-your-own-model run. + example: openai + type: string + model_name: + description: Model name used for a bring-your-own-model run. + example: gpt-4o + type: string + num_records: + description: Maximum number of records processed for the run. + example: 1000 + format: int32 + maximum: 2147483647 + type: integer + sampling_ratio: + description: Fraction of matching spans sampled for the run. + example: 0.1 + format: double + type: number + type: object + LLMObsPatternsConfigType: + description: Resource type of an LLM Observability patterns configuration. + enum: + - topic_discovery_configs + example: topic_discovery_configs + type: string + x-enum-varnames: + - TOPIC_DISCOVERY_CONFIGS + LLMObsPatternsConfigUpsertRequest: + description: Request to create or update an LLM Observability patterns configuration. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsConfigUpsertRequestData" + required: + - data + type: object + LLMObsPatternsConfigUpsertRequestAttributes: + description: Attributes for creating or updating an LLM Observability patterns configuration. + properties: + account_id: + description: Integration account ID for a bring-your-own-model configuration. + example: "1000000001" + type: string + config_id: + description: The ID of an existing configuration to update. If omitted, a new configuration is created. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + evp_query: + description: Query that selects the spans the patterns run analyzes. + example: "@ml_app:support-bot" + type: string + hierarchy_depth: + description: Depth of the topic hierarchy to generate. + example: 2 + format: int32 + maximum: 2147483647 + type: integer + integration_provider: + description: Integration provider for a bring-your-own-model configuration. + example: openai + type: string + model_name: + description: Model name for a bring-your-own-model configuration. + example: gpt-4o + type: string + name: + description: Name of the configuration. + example: "Support chatbot topics" + type: string + num_records: + description: Maximum number of records to process for the run. + example: 1000 + format: int32 + maximum: 2147483647 + type: integer + sampling_ratio: + description: Fraction of matching spans to sample for the run. + example: 0.1 + format: double + type: number + scope: + description: Scope of the configuration. + example: "" + type: string + template: + description: Template used to guide topic generation. + example: "" + type: string + required: + - name + - evp_query + - sampling_ratio + - num_records + - hierarchy_depth + type: object + LLMObsPatternsConfigUpsertRequestData: + description: Data object for creating or updating an LLM Observability patterns configuration. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsConfigUpsertRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsPatternsConfigType" + required: + - type + - attributes + type: object + LLMObsPatternsConfigsListType: + description: Resource type of a list of LLM Observability patterns configurations. + enum: + - list_topic_discovery_configs_response + example: list_topic_discovery_configs_response + type: string + x-enum-varnames: + - LIST_TOPIC_DISCOVERY_CONFIGS_RESPONSE + LLMObsPatternsConfigsResponse: + description: Response containing a list of LLM Observability patterns configurations. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsConfigsResponseData" + required: + - data + type: object + LLMObsPatternsConfigsResponseAttributes: + description: Attributes of a list of LLM Observability patterns configurations. + properties: + configs: + $ref: "#/components/schemas/LLMObsPatternsConfigItemsList" + required: + - configs + type: object + LLMObsPatternsConfigsResponseData: + description: Data object of a list of LLM Observability patterns configurations. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsConfigsResponseAttributes" + id: + description: Identifier of the list response. + example: "1000000001" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsConfigsListType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsProgressList: + description: List of step-by-step progress entries for a patterns run. + items: + $ref: "#/components/schemas/LLMObsPatternsActivityProgress" + type: array + LLMObsPatternsRequestType: + description: Resource type for triggering an LLM Observability patterns run. + enum: + - topic_discovery + example: topic_discovery + type: string + x-enum-varnames: + - TOPIC_DISCOVERY + LLMObsPatternsRunStatusResponse: + description: Response containing the status of an LLM Observability patterns run. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsRunStatusResponseData" + required: + - data + type: object + LLMObsPatternsRunStatusResponseAttributes: + description: Attributes of an LLM Observability patterns run status. + properties: + created_at: + description: Timestamp when the run was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + progress: + $ref: "#/components/schemas/LLMObsPatternsProgressList" + status: + description: Overall status of the run. + example: running + type: string + step: + description: The current step of the run. + example: generate_topics + type: string + required: + - created_at + - status + - step + - progress + type: object + LLMObsPatternsRunStatusResponseData: + description: Data object of an LLM Observability patterns run status response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsRunStatusResponseAttributes" + id: + description: The ID of the patterns run. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsRunStatusType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsRunStatusType: + description: Resource type of an LLM Observability patterns run status. + enum: + - topic_discovery_run_status + example: topic_discovery_run_status + type: string + x-enum-varnames: + - TOPIC_DISCOVERY_RUN_STATUS + LLMObsPatternsRunSummary: + description: Summary of an LLM Observability patterns run. + properties: + completed_at: + description: Timestamp when the run completed. Null if the run has not completed. + example: "2024-01-15T10:45:00Z" + format: date-time + nullable: true + type: string + config_snapshot: + $ref: "#/components/schemas/LLMObsPatternsConfigSnapshot" + created_at: + description: Timestamp when the run was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + id: + description: Unique identifier of the run. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + status: + description: Status of the run. + example: completed + type: string + required: + - id + - status + - created_at + type: object + LLMObsPatternsRunsList: + description: List of patterns runs. + items: + $ref: "#/components/schemas/LLMObsPatternsRunSummary" + type: array + LLMObsPatternsRunsListType: + description: Resource type of a list of LLM Observability patterns runs. + enum: + - list_topic_discovery_runs_response + example: list_topic_discovery_runs_response + type: string + x-enum-varnames: + - LIST_TOPIC_DISCOVERY_RUNS_RESPONSE + LLMObsPatternsRunsResponse: + description: Response containing the completed runs of an LLM Observability patterns configuration. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsRunsResponseData" + required: + - data + type: object + LLMObsPatternsRunsResponseAttributes: + description: Attributes of an LLM Observability patterns runs response. + properties: + runs: + $ref: "#/components/schemas/LLMObsPatternsRunsList" + required: + - runs + type: object + LLMObsPatternsRunsResponseData: + description: Data object of an LLM Observability patterns runs response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsRunsResponseAttributes" + id: + description: Identifier of the configuration the runs belong to. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsRunsListType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsTopic: + description: A topic discovered by an LLM Observability patterns run. + properties: + created_at: + description: Timestamp when the topic was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + description: + description: Description of the topic. + example: "Questions about invoices, charges, and refunds." + type: string + first_seen_at: + description: Timestamp when the topic was first seen. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + hierarchy_level: + description: Level of the topic in the hierarchy. Level 0 is a leaf topic. + example: 0 + format: int64 + type: integer + id: + description: Unique identifier of the topic. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + type: string + is_validated: + description: Whether the topic has been validated. + example: true + type: boolean + name: + description: Name of the topic. + example: "Billing questions" + type: string + parent_topic_id: + description: Identifier of the parent topic. Empty for top-level topics. + example: "" + type: string + point_count: + description: Number of data points assigned to the topic. + example: 125 + format: int64 + type: integer + run_id: + description: Identifier of the run that produced the topic. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + required: + - id + - run_id + - parent_topic_id + - hierarchy_level + - name + - description + - is_validated + - created_at + - point_count + - first_seen_at + type: object + LLMObsPatternsTopicWithClusteredPoints: + description: |- + A topic discovered by an LLM Observability patterns run, including the + clustered points attached to leaf topics. + properties: + cluster_points: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointRefsList" + created_at: + description: Timestamp when the topic was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + description: + description: Description of the topic. + example: "Questions about invoices, charges, and refunds." + type: string + first_seen_at: + description: Timestamp when the topic was first seen. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + hierarchy_level: + description: Level of the topic in the hierarchy. Level 0 is a leaf topic. + example: 0 + format: int64 + type: integer + id: + description: Unique identifier of the topic. + example: "5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21" + type: string + is_validated: + description: Whether the topic has been validated. + example: true + type: boolean + name: + description: Name of the topic. + example: "Billing questions" + type: string + parent_topic_id: + description: Identifier of the parent topic. Empty for top-level topics. + example: "" + type: string + point_count: + description: Number of data points assigned to the topic. + example: 125 + format: int64 + type: integer + run_id: + description: Identifier of the run that produced the topic. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + required: + - id + - run_id + - parent_topic_id + - hierarchy_level + - name + - description + - is_validated + - created_at + - point_count + - first_seen_at + type: object + LLMObsPatternsTopicsList: + description: List of discovered topics. + items: + $ref: "#/components/schemas/LLMObsPatternsTopic" + type: array + LLMObsPatternsTopicsResponse: + description: Response containing the topics discovered by an LLM Observability patterns run. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsTopicsResponseData" + required: + - data + type: object + LLMObsPatternsTopicsResponseAttributes: + description: Attributes of an LLM Observability patterns topics response. + properties: + completed_at: + description: Timestamp when the run completed. Null if the run has not completed. + example: "2024-01-15T10:45:00Z" + format: date-time + nullable: true + type: string + config_id: + description: Identifier of the configuration that produced the run. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + config_snapshot: + $ref: "#/components/schemas/LLMObsPatternsConfigSnapshot" + created_at: + description: Timestamp when the run was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + previous_run_id: + description: Identifier of the run that completed immediately before this one. Empty if none. + example: "" + type: string + run_id: + description: Identifier of the run that produced the topics. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + topics: + $ref: "#/components/schemas/LLMObsPatternsTopicsList" + required: + - run_id + - config_id + - previous_run_id + - created_at + - topics + type: object + LLMObsPatternsTopicsResponseData: + description: Data object of an LLM Observability patterns topics response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsTopicsResponseAttributes" + id: + description: Identifier of the run the topics belong to. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsTopicsType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsTopicsType: + description: Resource type of an LLM Observability patterns topics response. + enum: + - get_topics_response + example: get_topics_response + type: string + x-enum-varnames: + - GET_TOPICS_RESPONSE + LLMObsPatternsTopicsWithClusteredPointsList: + description: List of discovered topics with their clustered points. + items: + $ref: "#/components/schemas/LLMObsPatternsTopicWithClusteredPoints" + type: array + LLMObsPatternsTopicsWithClusteredPointsResponse: + description: |- + Response containing the topics, and the clustered points of their leaf topics, + discovered by an LLM Observability patterns run. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsTopicsWithClusteredPointsResponseData" + required: + - data + type: object + LLMObsPatternsTopicsWithClusteredPointsResponseAttributes: + description: Attributes of an LLM Observability patterns topics-with-clustered-points response. + properties: + completed_at: + description: Timestamp when the run completed. Null if the run has not completed. + example: "2024-01-15T10:45:00Z" + format: date-time + nullable: true + type: string + config_id: + description: Identifier of the configuration that produced the run. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + config_snapshot: + $ref: "#/components/schemas/LLMObsPatternsConfigSnapshot" + created_at: + description: Timestamp when the run was created. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + previous_run_id: + description: Identifier of the run that completed immediately before this one. Empty if none. + example: "" + type: string + run_id: + description: Identifier of the run that produced the topics. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + topics: + $ref: "#/components/schemas/LLMObsPatternsTopicsWithClusteredPointsList" + required: + - run_id + - config_id + - previous_run_id + - created_at + - topics + type: object + LLMObsPatternsTopicsWithClusteredPointsResponseData: + description: Data object of an LLM Observability patterns topics-with-clustered-points response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsTopicsWithClusteredPointsResponseAttributes" + id: + description: Identifier of the run the topics belong to. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsTopicsWithClusteredPointsType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsTopicsWithClusteredPointsType: + description: Resource type of an LLM Observability patterns topics-with-clustered-points response. + enum: + - get_topics_with_cluster_points_response + example: get_topics_with_cluster_points_response + type: string + x-enum-varnames: + - GET_TOPICS_WITH_CLUSTER_POINTS_RESPONSE + LLMObsPatternsTriggerRequest: + description: Request to trigger an LLM Observability patterns run. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsTriggerRequestData" + required: + - data + type: object + LLMObsPatternsTriggerRequestAttributes: + description: Attributes for triggering an LLM Observability patterns run. + properties: + config_id: + description: The ID of the patterns configuration to run. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + required: + - config_id + type: object + LLMObsPatternsTriggerRequestData: + description: Data object for triggering an LLM Observability patterns run. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsTriggerRequestAttributes" + type: + $ref: "#/components/schemas/LLMObsPatternsRequestType" + required: + - type + - attributes + type: object + LLMObsPatternsTriggerResponse: + description: Response after triggering an LLM Observability patterns run. + properties: + data: + $ref: "#/components/schemas/LLMObsPatternsTriggerResponseData" + required: + - data + type: object + LLMObsPatternsTriggerResponseAttributes: + description: Attributes of an LLM Observability patterns trigger response. + properties: + config_id: + description: The ID of the patterns configuration that was run. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + run_id: + description: The ID of the patterns run that was started. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + status: + description: Status of the patterns run. + example: started + type: string + required: + - run_id + - config_id + - status + type: object + LLMObsPatternsTriggerResponseData: + description: Data object of an LLM Observability patterns trigger response. + properties: + attributes: + $ref: "#/components/schemas/LLMObsPatternsTriggerResponseAttributes" + id: + description: The ID of the patterns configuration that was run. + example: "a7c8d9e0-1234-5678-9abc-def012345678" + type: string + type: + $ref: "#/components/schemas/LLMObsPatternsTriggerResponseType" + required: + - id + - type + - attributes + type: object + LLMObsPatternsTriggerResponseType: + description: Resource type of an LLM Observability patterns trigger response. + enum: + - topic_discovery_run + example: topic_discovery_run + type: string + x-enum-varnames: + - TOPIC_DISCOVERY_RUN LLMObsProjectDataAttributesRequest: description: Attributes for creating an LLM Observability project. properties: @@ -55216,6 +56587,40 @@ components: type: string x-enum-varnames: - MANAGED_ORGS + MaxSessionDurationType: + description: Data type of a maximum session duration update. + enum: [max_session_duration] + example: max_session_duration + type: string + x-enum-varnames: + - MAX_SESSION_DURATION + MaxSessionDurationUpdateAttributes: + description: Attributes for the maximum session duration update request. + properties: + max_session_duration: + description: The maximum session duration, in seconds. + example: 604800 + format: int64 + minimum: 1 + type: integer + required: [max_session_duration] + type: object + MaxSessionDurationUpdateData: + description: The data object for a maximum session duration update request. + properties: + attributes: + $ref: "#/components/schemas/MaxSessionDurationUpdateAttributes" + type: + $ref: "#/components/schemas/MaxSessionDurationType" + required: [type, attributes] + type: object + MaxSessionDurationUpdateRequest: + description: A request to update the maximum session duration for an organization. + properties: + data: + $ref: "#/components/schemas/MaxSessionDurationUpdateData" + required: [data] + type: object McpScanRequest: description: The top-level request object for submitting an MCP SCA dependency scan. properties: @@ -60959,6 +62364,7 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineDedupeProcessor" - $ref: "#/components/schemas/ObservabilityPipelineEnrichmentTableProcessor" - $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsV2Processor" - $ref: "#/components/schemas/ObservabilityPipelineOcsfMapperProcessor" - $ref: "#/components/schemas/ObservabilityPipelineParseGrokProcessor" - $ref: "#/components/schemas/ObservabilityPipelineParseJSONProcessor" @@ -62098,6 +63504,50 @@ components: type: string x-enum-varnames: - GENERATE_DATADOG_METRICS + ObservabilityPipelineGenerateMetricsV2Processor: + description: |- + The `generate_metrics` processor creates custom metrics from logs. + Metrics can be counters, gauges, or distributions and optionally grouped by log fields. + The generated metrics must be routed to a metrics destination using the input `.metrics`. + + **Supported pipeline types:** logs + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used to reference this component in other parts of the pipeline. + example: generate-metrics-processor + type: string + include: + description: A Datadog search query used to determine which logs this processor targets. + example: "service:my-service" + type: string + metrics: + description: Configuration for generating individual metrics. + items: + $ref: "#/components/schemas/ObservabilityPipelineGeneratedMetric" + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineGenerateMetricsV2ProcessorType" + required: + - id + - type + - enabled + type: object + x-pipeline-types: [logs] + ObservabilityPipelineGenerateMetricsV2ProcessorType: + default: generate_metrics + description: The processor type. Always `generate_metrics`. + enum: + - generate_metrics + example: generate_metrics + type: string + x-enum-varnames: + - GENERATE_METRICS ObservabilityPipelineGeneratedMetric: description: |- Defines a log-based custom metric, including its name, type, filter, value computation strategy, @@ -76652,223 +78102,6 @@ components: minimum: 0 type: number type: object - RumHardcodedCrossProductSampling: - description: Cross-product retention settings for a hardcoded retention filter. - properties: - session_replay_enabled: - description: Indicates whether Session Replay cross-product retention is active. - example: true - type: boolean - session_replay_sample_rate: - description: Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - example: 50.0 - format: double - maximum: 100 - minimum: 0 - type: number - trace_enabled: - description: Indicates whether Trace cross-product retention is active. - example: true - type: boolean - trace_sample_rate: - description: Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - example: 25.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedCrossProductSamplingEditability: - description: Flags indicating which `cross_product_sampling` fields can be updated. Read-only. - properties: - session_replay_sample_rate: - description: |- - If `true`, `cross_product_sampling.session_replay_sample_rate` can be updated on this filter. - example: true - type: boolean - trace_sample_rate: - description: If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. - example: false - type: boolean - type: object - RumHardcodedCrossProductSamplingUpdate: - description: |- - Partial update for cross-product retention of a hardcoded retention filter. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - properties: - session_replay_enabled: - description: Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. - example: true - type: boolean - session_replay_sample_rate: - description: |- - Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - Omit to leave unchanged. - example: 50.0 - format: double - maximum: 100 - minimum: 0 - type: number - trace_enabled: - description: Controls whether Trace cross-product retention is active. Omit to leave unchanged. - example: true - type: boolean - trace_sample_rate: - description: |- - Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - Omit to leave unchanged. - example: 25.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedRetentionFilterAttributes: - description: The attributes of a hardcoded retention filter. - properties: - cross_product_sampling: - $ref: "#/components/schemas/RumHardcodedCrossProductSampling" - cross_product_sampling_editability: - $ref: "#/components/schemas/RumHardcodedCrossProductSamplingEditability" - enabled: - description: Indicates whether the hardcoded retention filter is active. Read-only. - example: true - type: boolean - event_type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterEventType" - name: - description: The name of the hardcoded retention filter. Read-only. - example: Replay sessions - type: string - query: - description: The query string for the hardcoded retention filter. Read-only. - example: "@session.has_replay:true" - type: string - sample_rate: - description: The retention sample rate (0–100) for the hardcoded filter. Read-only. - example: 100.0 - format: double - maximum: 100 - minimum: 0 - type: number - type: object - RumHardcodedRetentionFilterData: - description: A hardcoded retention filter. - properties: - attributes: - $ref: "#/components/schemas/RumHardcodedRetentionFilterAttributes" - id: - description: The ID of the hardcoded retention filter. - example: forced_replay_sessions - type: string - meta: - $ref: "#/components/schemas/RumHardcodedRetentionFilterMeta" - type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterType" - type: object - RumHardcodedRetentionFilterEventType: - description: The type of RUM events the hardcoded filter applies to. Read-only. - enum: - - session - - view - - action - - error - - resource - - long_task - - vital - example: session - type: string - x-enum-varnames: - - SESSION - - VIEW - - ACTION - - ERROR - - RESOURCE - - LONG_TASK - - VITAL - RumHardcodedRetentionFilterMeta: - description: Metadata about the hardcoded retention filter. - properties: - source: - $ref: "#/components/schemas/RumHardcodedRetentionFilterMetaSource" - updated_at: - description: Unix epoch (in milliseconds) of the last update. - example: 1735689600000 - format: int64 - type: integer - updated_by_handle: - description: Handle of the user who last updated the filter. - example: jane.doe@example.com - type: string - type: object - RumHardcodedRetentionFilterMetaSource: - description: The source of the last update to a hardcoded retention filter. - enum: - - default - - ui - - terraform - example: ui - type: string - x-enum-varnames: - - DEFAULT - - UI - - TERRAFORM - RumHardcodedRetentionFilterResponse: - description: A hardcoded retention filter response body. - properties: - data: - $ref: "#/components/schemas/RumHardcodedRetentionFilterData" - type: object - RumHardcodedRetentionFilterType: - default: hardcoded_retention_filters - description: The resource type. The value must be `hardcoded_retention_filters`. - enum: - - hardcoded_retention_filters - example: hardcoded_retention_filters - type: string - x-enum-varnames: - - HARDCODED_RETENTION_FILTERS - RumHardcodedRetentionFilterUpdateAttributes: - description: |- - The attributes of a hardcoded retention filter that can be updated. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. - properties: - cross_product_sampling: - $ref: "#/components/schemas/RumHardcodedCrossProductSamplingUpdate" - type: object - RumHardcodedRetentionFilterUpdateData: - description: The hardcoded retention filter properties to update. - properties: - attributes: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateAttributes" - id: - description: The ID of the hardcoded retention filter. Must match the `rf_id` path parameter. - example: forced_replay_sessions - type: string - type: - $ref: "#/components/schemas/RumHardcodedRetentionFilterType" - required: - - id - - type - - attributes - type: object - RumHardcodedRetentionFilterUpdateRequest: - description: The hardcoded retention filter body to update. - properties: - data: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateData" - required: - - data - type: object - RumHardcodedRetentionFiltersResponse: - description: All hardcoded retention filters for a RUM application. - properties: - data: - description: A list of hardcoded retention filters. - items: - $ref: "#/components/schemas/RumHardcodedRetentionFilterData" - type: array - type: object RumMetricCompute: description: The compute rule to compute the RUM-based metric. properties: @@ -77567,6 +78800,27 @@ components: $ref: "#/components/schemas/RumRetentionFilterData" type: array type: object + RunDataObservabilityMonitorResponse: + description: The response returned when a data observability monitor run is triggered. + properties: + data: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponseData" + required: + - data + type: object + RunDataObservabilityMonitorResponseData: + description: The data object returned when a data observability monitor run is triggered. + properties: + id: + description: The unique identifier of the monitor run. + example: "abc123def456" + type: string + type: + $ref: "#/components/schemas/DataObservabilityMonitorRunType" + required: + - id + - type + type: object RunHistoricalJobRequest: description: Run a historical job request. properties: @@ -89039,6 +90293,37 @@ components: required: - slackTrigger type: object + SlackUserBindingData: + description: Slack team ID data from a response. + properties: + id: + description: The Slack team ID. + example: "T01234567" + type: string + type: + $ref: "#/components/schemas/SlackUserBindingType" + type: object + SlackUserBindingType: + default: team_id + description: Slack user binding resource type. + enum: + - team_id + example: team_id + type: string + x-enum-varnames: + - TEAM_ID + SlackUserBindingsResponse: + description: Response with a list of Slack user bindings. + properties: + data: + description: An array of Slack user bindings. + example: [{"id": "T01234567", "type": "team_id"}, {"id": "T09876543", "type": "team_id"}] + items: + $ref: "#/components/schemas/SlackUserBindingData" + type: array + required: + - data + type: object SloDataSource: default: slo description: A data source for SLO queries. @@ -96777,6 +98062,414 @@ components: format: int64 type: integer type: object + TagPoliciesListResponse: + description: A page of tag policies. + properties: + data: + $ref: "#/components/schemas/TagPolicyDataArray" + included: + $ref: "#/components/schemas/TagPolicyIncludedResources" + required: + - data + type: object + TagPolicyAttributes: + description: The attributes of a tag policy resource. + properties: + created_at: + description: The RFC 3339 timestamp at which the policy was created. + example: "2026-05-21T22:11:06.108696Z" + format: date-time + type: string + created_by: + description: The identifier of the user who created the policy. + example: "test-user" + type: string + deleted_at: + description: The RFC 3339 timestamp at which the policy was soft-deleted. `null` if the policy has not been deleted. Only present when `include_deleted=true` is requested. + format: date-time + nullable: true + type: string + deleted_by: + description: The identifier of the user who soft-deleted the policy. `null` if the policy has not been deleted. + nullable: true + type: string + enabled: + description: Whether the policy is currently enforced. + example: true + type: boolean + modified_at: + description: The RFC 3339 timestamp at which the policy was last modified. + example: "2026-05-21T22:11:06.108696Z" + format: date-time + type: string + modified_by: + description: The identifier of the user who last modified the policy. + example: "test-user" + type: string + negated: + description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + example: false + type: boolean + policy_name: + description: Human-readable name for the tag policy. + example: "Service tag must be one of api or web" + type: string + policy_type: + $ref: "#/components/schemas/TagPolicyType" + required: + description: When `true`, telemetry without this tag is treated as a violation. + example: true + type: boolean + scope: + description: The scope the policy applies within. + example: "env" + type: string + source: + $ref: "#/components/schemas/TagPolicySource" + tag_key: + description: The tag key that the policy governs. + example: "service" + type: string + tag_value_patterns: + description: The patterns that valid values for the tag key must match. + example: + - "api" + - "web" + items: + description: A pattern that valid tag values must match. + type: string + type: array + version: + description: A monotonically increasing version counter that is incremented on each update. + example: 1 + format: int64 + type: integer + required: + - policy_name + - source + - scope + - tag_key + - tag_value_patterns + - negated + - required + - enabled + - policy_type + - version + - created_at + - created_by + - modified_at + - modified_by + type: object + TagPolicyCreateAttributes: + description: Attributes that can be supplied when creating a tag policy. + properties: + enabled: + description: Whether the policy is currently enforced. Defaults to `true` for newly created policies. + example: true + type: boolean + negated: + description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. + example: false + type: boolean + policy_name: + description: Human-readable name for the tag policy. + example: "Service tag must be one of api or web" + type: string + policy_type: + $ref: "#/components/schemas/TagPolicyCreateType" + required: + description: When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. + example: true + type: boolean + scope: + description: |- + The scope the policy applies within. Typically an environment, team, or + organization-level identifier used to limit where the policy is enforced. + example: "env" + type: string + source: + $ref: "#/components/schemas/TagPolicySource" + tag_key: + description: The tag key that the policy governs (for example, `service`). + example: "service" + type: string + tag_value_patterns: + description: |- + One or more patterns that valid values for the tag key must match. At least one + pattern is required. + example: + - "api" + - "web" + items: + description: A pattern that valid tag values must match. + type: string + minItems: 1 + type: array + required: + - policy_name + - source + - scope + - tag_key + - tag_value_patterns + - policy_type + type: object + TagPolicyCreateData: + description: Data object for creating a tag policy. + properties: + attributes: + $ref: "#/components/schemas/TagPolicyCreateAttributes" + type: + $ref: "#/components/schemas/TagPolicyResourceType" + required: + - type + - attributes + type: object + TagPolicyCreateRequest: + description: Payload for creating a new tag policy. + properties: + data: + $ref: "#/components/schemas/TagPolicyCreateData" + required: + - data + type: object + TagPolicyCreateType: + description: |- + The policy type allowed when creating a tag policy. Only `surfacing` is accepted at + creation time. + enum: + - surfacing + example: "surfacing" + type: string + x-enum-varnames: + - SURFACING + TagPolicyData: + description: A tag policy resource. + properties: + attributes: + $ref: "#/components/schemas/TagPolicyAttributes" + id: + description: The unique identifier of the tag policy. + example: "123" + type: string + relationships: + $ref: "#/components/schemas/TagPolicyRelationships" + type: + $ref: "#/components/schemas/TagPolicyResourceType" + required: + - type + - id + - attributes + type: object + TagPolicyDataArray: + description: An array of tag policy data objects. + items: + $ref: "#/components/schemas/TagPolicyData" + type: array + TagPolicyInclude: + description: A related resource to include alongside a tag policy in the response. Currently the only supported value is `score`. + enum: + - score + example: "score" + type: string + x-enum-varnames: + - SCORE + TagPolicyIncludedResources: + description: Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. + items: + $ref: "#/components/schemas/TagPolicyScoreData" + type: array + TagPolicyRelationships: + description: Related resources for a tag policy. Only present when the corresponding `include` query parameter is supplied. + properties: + score: + $ref: "#/components/schemas/TagPolicyScoreRelationship" + type: object + TagPolicyResourceType: + description: JSON:API resource type for a tag policy. + enum: + - tag_policy + example: "tag_policy" + type: string + x-enum-varnames: + - TAG_POLICY + TagPolicyResponse: + description: A single tag policy. + properties: + data: + $ref: "#/components/schemas/TagPolicyData" + included: + $ref: "#/components/schemas/TagPolicyIncludedResources" + required: + - data + type: object + TagPolicyScoreAttributes: + description: Attributes of a tag policy compliance score. + properties: + score: + description: |- + The compliance score for the policy over the requested time window, as a percentage + between 0 and 100. `null` indicates that no relevant telemetry was found. + example: 80 + format: double + nullable: true + type: number + ts_end: + description: End of the time window the score was computed over, as a Unix timestamp in milliseconds. + example: 1779401466097 + format: int64 + type: integer + ts_start: + description: Start of the time window the score was computed over, as a Unix timestamp in milliseconds. + example: 1779315066097 + format: int64 + type: integer + version: + description: The version of the tag policy that the score was computed against. + example: 1 + format: int64 + type: integer + required: + - score + - ts_start + - ts_end + - version + type: object + TagPolicyScoreData: + description: A compliance score resource for a tag policy. + properties: + attributes: + $ref: "#/components/schemas/TagPolicyScoreAttributes" + id: + description: The unique identifier of the compliance score resource. + example: "123-v1-1779315066097-1779401466097" + type: string + type: + $ref: "#/components/schemas/TagPolicyScoreResourceType" + required: + - type + - id + - attributes + type: object + TagPolicyScoreRelationship: + description: A relationship to the compliance score resource for this policy. + properties: + data: + $ref: "#/components/schemas/TagPolicyScoreRelationshipData" + required: + - data + type: object + TagPolicyScoreRelationshipData: + description: Identifier of the related compliance score resource. + properties: + id: + description: The unique identifier of the related compliance score resource. + example: "123-v1-1779315066097-1779401466097" + type: string + type: + $ref: "#/components/schemas/TagPolicyScoreResourceType" + required: + - type + - id + type: object + TagPolicyScoreResourceType: + description: JSON:API resource type for a tag policy compliance score. + enum: + - tag_policy_score + example: "tag_policy_score" + type: string + x-enum-varnames: + - TAG_POLICY_SCORE + TagPolicyScoreResponse: + description: A tag policy compliance score. + properties: + data: + $ref: "#/components/schemas/TagPolicyScoreData" + required: + - data + type: object + TagPolicySource: + description: The telemetry source that a tag policy applies to. + enum: + - logs + - spans + - metrics + - rum + - feed + example: "logs" + type: string + x-enum-varnames: + - LOGS + - SPANS + - METRICS + - RUM + - FEED + TagPolicyType: + description: |- + How the policy is enforced. `blocking` rejects telemetry that violates the policy. + `surfacing` only highlights non-compliant telemetry without blocking it. + enum: + - blocking + - surfacing + example: "surfacing" + type: string + x-enum-varnames: + - BLOCKING + - SURFACING + TagPolicyUpdateAttributes: + description: |- + Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its + current value unchanged. The `source` of a policy cannot be changed. + properties: + enabled: + description: Whether the policy is currently enforced. + type: boolean + negated: + description: When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + type: boolean + policy_name: + description: Human-readable name for the tag policy. + type: string + policy_type: + $ref: "#/components/schemas/TagPolicyType" + required: + description: When `true`, telemetry without this tag is treated as a violation. + type: boolean + scope: + description: The scope the policy applies within. + type: string + tag_key: + description: The tag key that the policy governs. + type: string + tag_value_patterns: + description: One or more patterns that valid values for the tag key must match. + items: + description: A pattern that valid tag values must match. + type: string + type: array + type: object + TagPolicyUpdateData: + description: Data object for updating a tag policy. + properties: + attributes: + $ref: "#/components/schemas/TagPolicyUpdateAttributes" + id: + description: The unique identifier of the tag policy being updated. + example: "123" + type: string + type: + $ref: "#/components/schemas/TagPolicyResourceType" + required: + - type + - id + type: object + TagPolicyUpdateRequest: + description: Payload for updating an existing tag policy. Only the supplied fields are modified. + properties: + data: + $ref: "#/components/schemas/TagPolicyUpdateData" + required: + - data + type: object TagsEventAttribute: description: Array of tags associated with your event. example: ["team:A"] @@ -121836,6 +123529,11 @@ paths: name: filter[provider] schema: type: string + - description: Filter results to tag keys that have data for a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, all tag keys for the requested period are returned. + in: query + name: filter[metric] + schema: + type: string responses: "200": content: @@ -124410,6 +126108,105 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/data-observability/monitors/runs/{run_id}/status: + get: + description: Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + operationId: GetDataObservabilityMonitorRunStatus + parameters: + - description: The ID of the monitor run to retrieve status for. + example: "abc123def456" + in: path + name: run_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + status: ok + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/GetDataObservabilityMonitorRunStatusResponse" + description: OK + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Get data observability monitor run status + tags: + - Data Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/data-observability/monitors/{monitor_id}/run: + post: + description: Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + operationId: RunDataObservabilityMonitor + parameters: + - description: The ID of the data observability monitor to run. + example: 12345 + in: path + name: monitor_id + required: true + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + id: "abc123def456" + type: monitor_run + schema: + $ref: "#/components/schemas/RunDataObservabilityMonitorResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - data_observability_monitors_write + - monitors_write + summary: Run a data observability monitor + tags: + - Data Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/datasets: get: description: Get all datasets that have been configured for an organization. @@ -129405,6 +131202,94 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/global_orgs: + get: + description: |- + Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + operationId: ListGlobalOrgs + parameters: + - description: The handle of the authenticated user. + in: query + name: user_handle + required: true + schema: + example: user@example.com + type: string + - description: Maximum number of results returned. + in: query + name: page[limit] + required: false + schema: + default: 100 + format: int32 + maximum: 1000 + minimum: 1 + type: integer + - description: |- + String to query the next page of results. + This key is provided with each valid response from the API in `meta.page.next_cursor`. + in: query + name: page[cursor] + required: false + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + org: + name: Example Org + public_id: abcdef12345 + subdomain: example + uuid: "13d10a96-6ff2-49be-be7b-4f56ebb13335" + redirect_url: "https://app.datadoghq.com/account/login/password?dd_oid=13d10a96-6ff2-49be-be7b-4f56ebb13335&login_hint=user%40example.com" + source_region: us1.prod.dog + user: + handle: user@example.com + uuid: "cfab5cf9-5472-48ea-a79c-a64045f4f745" + type: global_user_orgs + links: + next: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100&page[cursor]=next-page" + self: "https://app.datadoghq.com/api/v2/global_orgs?user_handle=user@example.com&page[limit]=100" + meta: + page: + cursor: "" + limit: 100 + next_cursor: next-page + type: cursor + schema: + $ref: "#/components/schemas/GlobalOrgsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - user_access_read + summary: List global orgs + tags: + - Organizations + x-pagination: + cursorParam: page[cursor] + cursorPath: meta.page.next_cursor + limitParam: page[limit] + resultsPath: data + "x-permission": + operator: OR + permissions: + - user_access_read /api/v2/hamr: get: description: |- @@ -134141,6 +136026,43 @@ paths: operator: OR permissions: - gcp_configuration_edit + /api/v2/integration/google-chat/organizations: + get: + description: Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + operationId: ListGoogleChatOrganizations + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + domain_id: fake-domain-id + domain_name: example.com + id: 00000000-0000-0000-0000-000000000001 + relationships: + delegated_user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + type: google-chat-organization + - attributes: + domain_id: fake-domain-id-2 + domain_name: example2.com + id: 00000000-0000-0000-0000-000000000003 + type: google-chat-organization + schema: + $ref: "#/components/schemas/GoogleChatOrganizationsResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all Google Chat organization bindings + tags: + - Google Chat Integration /api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}: get: description: Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. @@ -134177,6 +136099,110 @@ paths: summary: Get space information by display name tags: - Google Chat Integration + /api/v2/integration/google-chat/organizations/{organization_binding_id}: + delete: + description: Delete a Google Chat organization binding from the Datadog Google Chat integration. + operationId: DeleteGoogleChatOrganization + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "204": + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a Google Chat organization binding + tags: + - Google Chat Integration + get: + description: Get a Google Chat organization binding from the Datadog Google Chat integration. + operationId: GetGoogleChatOrganization + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + domain_id: fake-domain-id + domain_name: example.com + id: 00000000-0000-0000-0000-000000000001 + relationships: + delegated_user: + data: + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + type: google-chat-organization + schema: + $ref: "#/components/schemas/GoogleChatOrganizationResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a Google Chat organization binding + tags: + - Google Chat Integration + /api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user: + delete: + description: Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat integration. + operationId: DeleteGoogleChatDelegatedUser + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete the delegated user + tags: + - Google Chat Integration + get: + description: Get the delegated user for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: GetGoogleChatDelegatedUser + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + display_name: fake-display-name + email: user@example.com + features: + - incident-automatic-space-creation + - workflow-space-creation + id: 00000000-0000-0000-0000-000000000002 + type: google-chat-delegated-user + schema: + $ref: "#/components/schemas/GoogleChatDelegatedUserResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get the delegated user + tags: + - Google Chat Integration /api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles: get: description: Get a list of all organization handles from the Datadog Google Chat integration. @@ -134377,6 +136403,191 @@ paths: tags: - Google Chat Integration x-codegen-request-body-name: body + /api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences: + get: + description: Get a list of all target audiences for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: ListGoogleChatTargetAudiences + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + - attributes: + audience_id: fake-audience-id-2 + audience_name: fake-audience-name-2 + id: 00000000-0000-0000-0000-000000000005 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudiencesResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get all target audiences + tags: + - Google Chat Integration + post: + description: Create a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: CreateGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceCreateRequest" + description: Target audience payload. + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: CREATED + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a target audience + tags: + - Google Chat Integration + x-codegen-request-body-name: body + /api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}: + delete: + description: Delete a target audience from a Google Chat organization binding in the Datadog Google Chat integration. + operationId: DeleteGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + responses: + "204": + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a target audience + tags: + - Google Chat Integration + get: + description: Get a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: GetGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: fake-audience-id-1 + audience_name: fake audience name 1 + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a target audience + tags: + - Google Chat Integration + patch: + description: Update a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + operationId: UpdateGoogleChatTargetAudience + parameters: + - $ref: "#/components/parameters/GoogleChatOrganizationBindingIdPathParameter" + - $ref: "#/components/parameters/GoogleChatTargetAudienceIdPathParameter" + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: updated-audience-id + audience_name: updated-audience-name + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceUpdateRequest" + description: Target audience payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + audience_id: updated-audience-id + audience_name: updated-audience-name + id: 00000000-0000-0000-0000-000000000004 + type: google-chat-target-audience + schema: + $ref: "#/components/schemas/GoogleChatTargetAudienceResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a target audience + tags: + - Google Chat Integration + x-codegen-request-body-name: body /api/v2/integration/jira/accounts: get: description: |- @@ -134917,6 +137128,26 @@ paths: tags: - Microsoft Teams Integration x-codegen-request-body-name: body + /api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}: + delete: + description: Delete the user binding for a given tenant from the Datadog Microsoft Teams integration. + operationId: DeleteMSTeamsUserBinding + parameters: + - $ref: "#/components/parameters/MicrosoftTeamsTenantIDPathParameter" + responses: + "204": + description: No Content + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "412": + $ref: "#/components/responses/PreconditionFailedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete user binding + tags: + - Microsoft Teams Integration /api/v2/integration/ms-teams/configuration/workflows-webhook-handles: get: description: Get a list of all Workflows webhook handles from the Datadog Microsoft Teams integration. @@ -136401,6 +138632,36 @@ paths: summary: List ServiceNow users tags: - ServiceNow Integration + /api/v2/integration/slack/user-bindings: + get: + description: List all Slack user bindings for a given Datadog user from the Datadog Slack integration. + operationId: ListSlackUserBindings + parameters: + - $ref: "#/components/parameters/SlackUserUuidQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: T01234567 + type: team_id + - id: T09876543 + type: team_id + schema: + $ref: "#/components/schemas/SlackUserBindingsResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List Slack user bindings + tags: + - Slack Integration /api/v2/integration/statuspage/account: delete: description: Delete the Statuspage account configured for your organization. @@ -140695,133 +142956,854 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: Update an LLM Observability project + summary: Update an LLM Observability project + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/spans/events: + get: + description: List LLM Observability spans matching the specified filters. + operationId: ListLLMObsSpans + parameters: + - description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. + in: query + name: filter[from] + schema: + example: "now-900s" + type: string + - description: End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. + in: query + name: filter[to] + schema: + example: "now" + type: string + - description: >- + Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`filter[span_id]`, `filter[trace_id]`, etc.) are ignored. + in: query + name: filter[query] + schema: + example: "@session_id:abc123def456" + type: string + - description: Filter by exact span ID. + in: query + name: filter[span_id] + schema: + type: string + - description: Filter by exact trace ID. + in: query + name: filter[trace_id] + schema: + type: string + - description: Filter by span kind (e.g., llm, agent, tool, task, workflow). + in: query + name: filter[span_kind] + schema: + type: string + - description: Filter by span name. + in: query + name: filter[span_name] + schema: + type: string + - description: Filter by ML application name. + in: query + name: filter[ml_app] + schema: + type: string + - description: Maximum number of spans to return. Defaults to `10`. + in: query + name: page[limit] + schema: + format: int64 + type: integer + - description: Cursor from the previous response to retrieve the next page. + in: query + name: page[cursor] + schema: + type: string + - description: Sort order for the results. + in: query + name: sort + schema: + type: string + - description: Whether to include attachment data in the response. Defaults to `true`. + in: query + name: include_attachments + schema: + type: boolean + responses: + "200": + content: + application/json: + examples: + default: + summary: List spans for an ML app + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done + session_id: + summary: List spans filtered by session ID + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + tags: + - "session_id:abc123def456" + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 87 + page: {} + request_id: req-def456 + status: done + schema: + $ref: "#/components/schemas/LLMObsSpansResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM Observability spans + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/spans/events/search: + post: + description: Search LLM Observability spans using structured filters in the request body. + operationId: SearchLLMObsSpans + requestBody: + content: + application/json: + examples: + default: + summary: Search spans for an ML app + value: + data: + attributes: + filter: + from: "now-900s" + ml_app: "my-llm-app" + span_kind: "llm" + to: "now" + options: + include_attachments: true + page: + limit: 10 + type: spans + session_id: + summary: Search all spans in a session + value: + data: + attributes: + filter: + from: "now-900s" + query: "@session_id:abc123def456" + to: "now" + options: + include_attachments: true + page: + limit: 50 + type: spans + schema: + $ref: "#/components/schemas/LLMObsSearchSpansRequest" + description: Search spans payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + duration: 1500000000.0 + ml_app: my-llm-app + model_name: gpt-4o + model_provider: openai + name: llm_call + span_id: "abc123def456" + span_kind: llm + start_ns: 1705314600000000000 + status: ok + trace_id: "trace-9a8b7c6d5e4f" + id: "abc123def456" + type: span + meta: + elapsed: 132 + page: {} + request_id: req-abc123 + status: done + schema: + $ref: "#/components/schemas/LLMObsSpansResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Search LLM Observability spans + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-clustered-points: + get: + description: |- + List the data points grouped into a topic. For a parent topic, points from all + of its leaf topics are returned. + operationId: ListLLMObsPatternsClusteredPoints + parameters: + - $ref: "#/components/parameters/LLMObsPatternsTopicIDQueryParameter" + - $ref: "#/components/parameters/LLMObsPatternsPageSizeQueryParameter" + - $ref: "#/components/parameters/LLMObsPatternsPageTokenQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + next_page_token: "eyJvZmZzZXQiOjUwfQ==" + points: + - event_id: AAAAAYabc123 + id: 9b0c1d2e-3f40-5a61-b728-c9d0e1f2a3b4 + input: "How do I get a refund?" + is_included: false + is_suggested: true + session_id: session-7c3f5a1b + span_id: "1234567890123456789" + topic_id: 5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21 + topic_id: 5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21 + id: 5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21 + type: clustered_points_response + schema: + $ref: "#/components/schemas/LLMObsPatternsClusteredPointsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List patterns clustered points + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-configs: + get: + description: List all patterns configurations for the organization. + operationId: ListLLMObsPatternsConfigs + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + configs: + - created_at: "2024-01-15T10:30:00Z" + evp_query: "@ml_app:support-bot" + hierarchy_depth: 2 + id: a7c8d9e0-1234-5678-9abc-def012345678 + name: Support chatbot topics + num_records: 1000 + sampling_ratio: 0.1 + scope: "" + updated_at: "2024-01-15T10:30:00Z" + id: "1000000001" + type: list_topic_discovery_configs_response + schema: + $ref: "#/components/schemas/LLMObsPatternsConfigsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List patterns configurations + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: Create a new patterns configuration, or update an existing one when a configuration ID is provided. + operationId: UpsertLLMObsPatternsConfig + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + evp_query: "@ml_app:support-bot" + hierarchy_depth: 2 + name: Support chatbot topics + num_records: 1000 + sampling_ratio: 0.1 + type: topic_discovery_configs + schema: + $ref: "#/components/schemas/LLMObsPatternsConfigUpsertRequest" + description: Patterns configuration payload. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + evp_query: "@ml_app:support-bot" + hierarchy_depth: 2 + name: Support chatbot topics + num_records: 1000 + sampling_ratio: 0.1 + scope: "" + updated_at: "2024-01-15T10:30:00Z" + id: a7c8d9e0-1234-5678-9abc-def012345678 + type: topic_discovery_configs + schema: + $ref: "#/components/schemas/LLMObsPatternsConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Create or update a patterns configuration + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-configs/latest: + get: + description: Retrieve the patterns configuration for the organization. + operationId: GetLLMObsPatternsConfig + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + evp_query: "@ml_app:support-bot" + hierarchy_depth: 2 + name: Support chatbot topics + num_records: 1000 + sampling_ratio: 0.1 + scope: "" + updated_at: "2024-01-15T10:30:00Z" + id: a7c8d9e0-1234-5678-9abc-def012345678 + type: topic_discovery_configs + schema: + $ref: "#/components/schemas/LLMObsPatternsConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get a patterns configuration + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-configs/{config_id}: + delete: + description: Delete a patterns configuration by its ID. + operationId: DeleteLLMObsPatternsConfig + parameters: + - $ref: "#/components/parameters/LLMObsPatternsConfigIDPathParameter" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Delete a patterns configuration + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-runs: + get: + description: List the completed patterns runs for a configuration. + operationId: ListLLMObsPatternsRuns + parameters: + - $ref: "#/components/parameters/LLMObsPatternsConfigIDQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + runs: + - completed_at: "2024-01-15T10:45:00Z" + created_at: "2024-01-15T10:30:00Z" + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + status: completed + id: a7c8d9e0-1234-5678-9abc-def012345678 + type: list_topic_discovery_runs_response + schema: + $ref: "#/components/schemas/LLMObsPatternsRunsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List patterns runs + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Start a patterns run for a given configuration. The run executes asynchronously. + operationId: TriggerLLMObsPatterns + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + config_id: a7c8d9e0-1234-5678-9abc-def012345678 + type: topic_discovery + schema: + $ref: "#/components/schemas/LLMObsPatternsTriggerRequest" + description: Trigger patterns payload. + required: true + responses: + "202": + content: + application/json: + examples: + default: + value: + data: + attributes: + config_id: a7c8d9e0-1234-5678-9abc-def012345678 + run_id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + status: started + id: a7c8d9e0-1234-5678-9abc-def012345678 + type: topic_discovery_run + schema: + $ref: "#/components/schemas/LLMObsPatternsTriggerResponse" + description: Accepted + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Trigger a patterns run + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/topic-discovery-runs/status: + get: + description: |- + Retrieve the status and step-by-step progress of the current or most recent + patterns run for a configuration. + operationId: GetLLMObsPatternsRunStatus + parameters: + - $ref: "#/components/parameters/LLMObsPatternsConfigIDQueryParameter" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2024-01-15T10:30:00Z" + progress: + - name: query_evp + started_at: "2024-01-15T10:30:05Z" + status: completed + - name: generate_topics + started_at: "2024-01-15T10:32:00Z" + status: running + status: running + step: generate_topics + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + type: topic_discovery_run_status + schema: + $ref: "#/components/schemas/LLMObsPatternsRunStatusResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get patterns run status tags: - LLM Observability x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v1/spans/events: + /api/v2/llm-obs/v1/topic-discovery-topics: get: - description: List LLM Observability spans matching the specified filters. - operationId: ListLLMObsSpans + description: |- + List the topics discovered by a patterns run. When no run is specified, + the most recent completed run is used. + operationId: ListLLMObsPatternsTopics parameters: - - description: Start of the time range. Accepts ISO 8601 or relative format (e.g., `now-15m`). Defaults to `now-15m`. - in: query - name: filter[from] - schema: - example: "now-900s" - type: string - - description: End of the time range. Accepts ISO 8601 or relative format. Defaults to `now`. - in: query - name: filter[to] - schema: - example: "now" - type: string - - description: >- - Search query using LLM Observability query syntax. Supports attribute filters using the field:value syntax (e.g. session_id, trace_id, ml_app, meta.span.kind). When provided, structured field filters (`filter[span_id]`, `filter[trace_id]`, etc.) are ignored. - in: query - name: filter[query] - schema: - example: "@session_id:abc123def456" - type: string - - description: Filter by exact span ID. - in: query - name: filter[span_id] - schema: - type: string - - description: Filter by exact trace ID. - in: query - name: filter[trace_id] - schema: - type: string - - description: Filter by span kind (e.g., llm, agent, tool, task, workflow). - in: query - name: filter[span_kind] - schema: - type: string - - description: Filter by span name. - in: query - name: filter[span_name] - schema: - type: string - - description: Filter by ML application name. - in: query - name: filter[ml_app] - schema: - type: string - - description: Maximum number of spans to return. Defaults to `10`. - in: query - name: page[limit] - schema: - format: int64 - type: integer - - description: Cursor from the previous response to retrieve the next page. - in: query - name: page[cursor] - schema: - type: string - - description: Sort order for the results. - in: query - name: sort - schema: - type: string - - description: Whether to include attachment data in the response. Defaults to `true`. - in: query - name: include_attachments - schema: - type: boolean + - $ref: "#/components/parameters/LLMObsPatternsConfigIDQueryParameter" + - $ref: "#/components/parameters/LLMObsPatternsRunIDQueryParameter" responses: "200": content: application/json: examples: default: - summary: List spans for an ML app value: data: - - attributes: - duration: 1500000000.0 - ml_app: my-llm-app - model_name: gpt-4o - model_provider: openai - name: llm_call - span_id: "abc123def456" - span_kind: llm - start_ns: 1705314600000000000 - status: ok - trace_id: "trace-9a8b7c6d5e4f" - id: "abc123def456" - type: span - meta: - elapsed: 132 - page: {} - request_id: req-abc123 - status: done - session_id: - summary: List spans filtered by session ID - value: - data: - - attributes: - duration: 1500000000.0 - ml_app: my-llm-app - name: llm_call - span_id: "abc123def456" - span_kind: llm - start_ns: 1705314600000000000 - status: ok - tags: - - "session_id:abc123def456" - trace_id: "trace-9a8b7c6d5e4f" - id: "abc123def456" - type: span - meta: - elapsed: 87 - page: {} - request_id: req-def456 - status: done + attributes: + completed_at: "2024-01-15T10:45:00Z" + config_id: a7c8d9e0-1234-5678-9abc-def012345678 + created_at: "2024-01-15T10:30:00Z" + previous_run_id: "" + run_id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + topics: + - created_at: "2024-01-15T10:44:00Z" + description: "Questions about invoices, charges, and refunds." + first_seen_at: "2024-01-15T10:44:00Z" + hierarchy_level: 0 + id: 5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21 + is_validated: true + name: Billing questions + parent_topic_id: "" + point_count: 125 + run_id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + type: get_topics_response schema: - $ref: "#/components/schemas/LLMObsSpansResponse" + $ref: "#/components/schemas/LLMObsPatternsTopicsResponse" description: OK "400": content: @@ -140841,58 +143823,40 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM Observability spans + summary: List patterns topics tags: - LLM Observability x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v1/spans/events/search: - post: - description: Search LLM Observability spans using structured filters in the request body. - operationId: SearchLLMObsSpans - requestBody: - content: - application/json: - examples: - default: - summary: Search spans for an ML app - value: - data: - attributes: - filter: - from: "now-900s" - ml_app: "my-llm-app" - span_kind: "llm" - to: "now" - options: - include_attachments: true - page: - limit: 10 - type: spans - session_id: - summary: Search all spans in a session - value: - data: - attributes: - filter: - from: "now-900s" - query: "@session_id:abc123def456" - to: "now" - options: - include_attachments: true - page: - limit: 50 - type: spans - schema: - $ref: "#/components/schemas/LLMObsSearchSpansRequest" - description: Search spans payload. - required: true + /api/v2/llm-obs/v1/topic-discovery-topics/with-cluster-points: + get: + description: |- + List the topics discovered by a patterns run, with the clustered points attached + inline to each leaf topic. When no run is specified, the most recent completed + run is used. + operationId: ListLLMObsPatternsTopicsWithClusteredPoints + parameters: + - $ref: "#/components/parameters/LLMObsPatternsConfigIDQueryParameter" + - $ref: "#/components/parameters/LLMObsPatternsRunIDQueryParameter" + - $ref: "#/components/parameters/LLMObsPatternsIncludeMetricsQueryParameter" responses: "200": content: @@ -140901,26 +143865,37 @@ paths: default: value: data: - - attributes: - duration: 1500000000.0 - ml_app: my-llm-app - model_name: gpt-4o - model_provider: openai - name: llm_call - span_id: "abc123def456" - span_kind: llm - start_ns: 1705314600000000000 - status: ok - trace_id: "trace-9a8b7c6d5e4f" - id: "abc123def456" - type: span - meta: - elapsed: 132 - page: {} - request_id: req-abc123 - status: done - schema: - $ref: "#/components/schemas/LLMObsSpansResponse" + attributes: + completed_at: "2024-01-15T10:45:00Z" + config_id: a7c8d9e0-1234-5678-9abc-def012345678 + created_at: "2024-01-15T10:30:00Z" + previous_run_id: "" + run_id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + topics: + - cluster_points: + - duration: 1500000 + estimated_total_cost: 0.0021 + evaluation: + sentiment: positive + input_tokens: 128 + output_tokens: 64 + span_id: "1234567890123456789" + status: ok + total_tokens: 192 + created_at: "2024-01-15T10:44:00Z" + description: "Questions about invoices, charges, and refunds." + first_seen_at: "2024-01-15T10:44:00Z" + hierarchy_level: 0 + id: 5c1fae90-2b6d-4e3a-9f12-7a0c4d8e6b21 + is_validated: true + name: Billing questions + parent_topic_id: "" + point_count: 125 + run_id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + type: get_topics_with_cluster_points_response + schema: + $ref: "#/components/schemas/LLMObsPatternsTopicsWithClusteredPointsResponse" description: OK "400": content: @@ -140940,12 +143915,24 @@ paths: schema: $ref: "#/components/schemas/JSONAPIErrorResponse" description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found "429": $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error security: - apiKeyAuth: [] appKeyAuth: [] - summary: Search LLM Observability spans + summary: List patterns topics with clustered points tags: - LLM Observability x-unstable: |- @@ -142314,203 +145301,244 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - summary: List LLM Observability experiment events (v2) + summary: List LLM Observability experiment events (v2) + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v2/{project_id}/datasets/{dataset_id}/records/upload: + post: + description: |- + Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. + Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. + + The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: + - `progress`: incremental record counts written so far. + - `completed`: terminal event with a JSON body containing `records_created`. + - `error`: terminal event with a JSON body containing an error `message`. + operationId: UploadLLMObsDatasetRecordsFile + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + - description: Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. + in: query + name: deduplicate + schema: + default: false + type: boolean + - description: Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. + in: query + name: overwrite + schema: + default: true + type: boolean + - description: Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. + in: query + name: tags + schema: + items: + type: string + type: array + - description: Whether to enrich the response with user metadata. + in: query + name: "include[user_data]" + schema: + type: boolean + requestBody: + content: + multipart/form-data: + examples: + default: + value: + file: records.csv + schema: + $ref: "#/components/schemas/LLMObsDatasetRecordsUploadFile" + description: Multipart upload payload containing the records file. + required: true + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Upload records to an LLM Observability dataset + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v3/experiments/{experiment_id}/events: + get: + description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. + operationId: ListLLMObsExperimentEvents + parameters: + - $ref: "#/components/parameters/LLMObsExperimentIDPathParameter" + - description: Maximum number of spans to return per page. Defaults to 5000. + in: query + name: page[limit] + schema: + default: 5000 + format: int64 + type: integer + - description: Opaque cursor from a previous response to fetch the next page of results. + in: query + name: page[cursor] + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + spans: + - duration: 1500000000.0 + eval_metrics: [] + id: 00000000-0000-0000-0000-000000000002 + name: llm_call + span_id: span-7a1b2c3d + start_ns: 1705314600000000000 + status: ok + tags: [] + trace_id: abc123def456 + summary_metrics: [] + id: 00000000-0000-0000-0000-000000000001 + type: experiment_events + meta: + after: + schema: + $ref: "#/components/schemas/LLMObsExperimentEventsV2Response" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List events for an LLM Observability experiment tags: - LLM Observability x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v2/{project_id}/datasets/{dataset_id}/records/upload: - post: + /api/v2/login/org_configs/max_session_duration: + put: description: |- - Upload records to a dataset from a file. The request is a `multipart/form-data` upload containing a single `file` part. - Currently only CSV is supported. The CSV must include an `input` column. Optional columns are `id`, `expected_output`, `metadata`, and `tags`. - - The response is a Server-Sent Events stream (`text/event-stream`) emitting progress updates while records are processed. The stream emits the following named events: - - `progress`: incremental record counts written so far. - - `completed`: terminal event with a JSON body containing `records_created`. - - `error`: terminal event with a JSON body containing an error `message`. - operationId: UploadLLMObsDatasetRecordsFile - parameters: - - description: The ID of the LLM Observability project. - example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" - in: path - name: project_id - required: true - schema: - type: string - - description: The ID of the LLM Observability dataset. - example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" - in: path - name: dataset_id - required: true - schema: - type: string - - description: Whether to skip records whose `input` already exists in the dataset. Defaults to `false`. - in: query - name: deduplicate - schema: - default: false - type: boolean - - description: Whether to overwrite existing records that share the same user-provided `id`. Defaults to `true`. - in: query - name: overwrite - schema: - default: true - type: boolean - - description: Tags to apply to every uploaded record, in addition to any tags defined on individual rows. Can be repeated, e.g. `tags=env:prod&tags=team:ai`. - in: query - name: tags - schema: - items: - type: string - type: array - - description: Whether to enrich the response with user metadata. - in: query - name: "include[user_data]" - schema: - type: boolean + Update the maximum session duration for the current organization. + The duration is specified in seconds. + operationId: UpdateLoginOrgConfigsMaxSessionDuration requestBody: content: - multipart/form-data: + application/json: examples: default: value: - file: records.csv + data: + attributes: + max_session_duration: 604800 + type: max_session_duration schema: - $ref: "#/components/schemas/LLMObsDatasetRecordsUploadFile" - description: Multipart upload payload containing the records file. + $ref: "#/components/schemas/MaxSessionDurationUpdateRequest" required: true responses: - "200": - description: OK - "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request - "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized - "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - "500": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Internal Server Error - security: - - apiKeyAuth: [] - appKeyAuth: [] - summary: Upload records to an LLM Observability dataset - tags: - - LLM Observability - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - /api/v2/llm-obs/v3/experiments/{experiment_id}/events: - get: - description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. - operationId: ListLLMObsExperimentEvents - parameters: - - $ref: "#/components/parameters/LLMObsExperimentIDPathParameter" - - description: Maximum number of spans to return per page. Defaults to 5000. - in: query - name: page[limit] - schema: - default: 5000 - format: int64 - type: integer - - description: Opaque cursor from a previous response to fetch the next page of results. - in: query - name: page[cursor] - schema: - type: string - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - spans: - - duration: 1500000000.0 - eval_metrics: [] - id: 00000000-0000-0000-0000-000000000002 - name: llm_call - span_id: span-7a1b2c3d - start_ns: 1705314600000000000 - status: ok - tags: [] - trace_id: abc123def456 - summary_metrics: [] - id: 00000000-0000-0000-0000-000000000001 - type: experiment_events - meta: - after: - schema: - $ref: "#/components/schemas/LLMObsExperimentEventsV2Response" - description: OK + "204": + description: No Content "400": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Bad Request + $ref: "#/components/responses/BadRequestResponse" "401": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Unauthorized + $ref: "#/components/responses/UnauthorizedResponse" "403": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Forbidden - "404": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Not Found + $ref: "#/components/responses/ForbiddenResponse" "429": $ref: "#/components/responses/TooManyRequestsResponse" - "500": - content: - application/json: - schema: - $ref: "#/components/schemas/JSONAPIErrorResponse" - description: Internal Server Error security: - apiKeyAuth: [] appKeyAuth: [] - summary: List events for an LLM Observability experiment - tags: - - LLM Observability - x-unstable: |- - **Note**: This endpoint is in preview and is subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + - AuthZ: + - org_management + summary: Update the maximum session duration + tags: [Organizations] + "x-permission": + operator: OR + permissions: + - org_management /api/v2/logs: post: description: |- @@ -158979,167 +162007,6 @@ paths: operator: OR permissions: - rum_apps_write - /api/v2/rum/applications/{app_id}/hardcoded_retention_filters: - get: - description: Get the list of hardcoded retention filters for a RUM application. - operationId: ListHardcodedRetentionFilters - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFiltersResponse" - description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get all hardcoded retention filters - tags: - - RUM Retention Filters Hardcoded - /api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}: - get: - description: Get a single hardcoded retention filter for a RUM application. - operationId: GetHardcodedRetentionFilter - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" - description: OK - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Get a hardcoded retention filter - tags: - - RUM Retention Filters Hardcoded - patch: - description: |- - Update the cross-product sample rates of a hardcoded retention filter for a RUM application. - Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - Any other field is read-only and cannot be sent in the payload. - Returns the updated hardcoded retention filter when the request is successful. - operationId: UpdateHardcodedRetentionFilter - parameters: - - $ref: "#/components/parameters/RumHardcodedRetentionFilterApplicationIDParameter" - - $ref: "#/components/parameters/RumHardcodedRetentionFilterIDParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - id: forced_replay_sessions - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterUpdateRequest" - description: New cross-product sample rates for the hardcoded retention filter. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - cross_product_sampling: - session_replay_enabled: true - session_replay_sample_rate: 50.0 - trace_enabled: true - trace_sample_rate: 25.0 - cross_product_sampling_editability: - session_replay_sample_rate: true - trace_sample_rate: false - enabled: true - event_type: session - name: Replay sessions - query: "@session.has_replay:true" - sample_rate: 100.0 - id: forced_replay_sessions - meta: - source: ui - updated_at: 1735689600000 - updated_by_handle: jane.doe@example.com - type: hardcoded_retention_filters - schema: - $ref: "#/components/schemas/RumHardcodedRetentionFilterResponse" - description: Updated - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - summary: Update a hardcoded retention filter - tags: - - RUM Retention Filters Hardcoded - x-codegen-request-body-name: body /api/v2/rum/applications/{app_id}/relationships/retention_filters: patch: description: |- @@ -168859,6 +171726,60 @@ paths: operator: OR permissions: - security_monitoring_rules_read + /api/v2/security_monitoring/rules/{rule_id}/restore/{version}: + post: + description: |- + Restores a custom detection rule to a previously saved historical version. + Only custom rules can be restored. Default and partner rules return 400. + The restore creates a new version entry; it does not overwrite history. + operationId: RestoreSecurityMonitoringRule + parameters: + - $ref: "#/components/parameters/SecurityMonitoringRuleID" + - $ref: "#/components/parameters/SecurityMonitoringRuleVersion" + responses: + "200": + content: + "application/json": + examples: + default: + value: + cases: + - condition: "a > 0" + name: "" + notifications: [] + status: info + id: abc-123 + isEnabled: true + message: Test rule + name: My security monitoring rule. + tags: [] + type: log_detection + schema: + $ref: "#/components/schemas/SecurityMonitoringRuleResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "409": + $ref: "#/components/responses/ConflictResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_rules_write + summary: Restore a rule to a historical version + tags: ["Security Monitoring"] + "x-permission": + operator: OR + permissions: + - security_monitoring_rules_write + x-unstable: |- + **Note**: This endpoint is in beta and may be subject to changes. /api/v2/security_monitoring/rules/{rule_id}/test: post: description: |- @@ -171556,123 +174477,6 @@ paths: operator: OR permissions: - service_account_write - /api/v2/services: - get: - deprecated: true - description: >- - Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services. - operationId: ListIncidentServices - parameters: - - $ref: "#/components/parameters/IncidentServiceIncludeQueryParameter" - - $ref: "#/components/parameters/PageSize" - - $ref: "#/components/parameters/PageOffset" - - $ref: "#/components/parameters/IncidentServiceSearchQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000002 - type: services - schema: - $ref: "#/components/schemas/IncidentServicesResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get a list of all incident services - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. - post: - deprecated: true - description: Creates a new incident service. - operationId: CreateIncidentService - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: an example service name - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: services - schema: - $ref: "#/components/schemas/IncidentServiceCreateRequest" - description: Incident Service Payload. - required: true - responses: - "201": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000001 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: CREATED - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Create a new incident service - tags: - - Incident Services - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. /api/v2/services/definitions: get: description: Get a list of all service definitions from the Datadog Service Catalog. @@ -171885,159 +174689,6 @@ paths: operator: OR permissions: - apm_service_catalog_read - /api/v2/services/{service_id}: - delete: - deprecated: true - description: Deletes an existing incident service. - operationId: DeleteIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - responses: - "204": - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Delete an existing incident service - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. - get: - deprecated: true - description: |- - Get details of an incident service. If the `include[users]` query parameter is provided, - the included attribute will contain the users related to these incident services. - operationId: GetIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - - $ref: "#/components/parameters/IncidentServiceIncludeQueryParameter" - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000004 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_read - summary: Get details of an incident service - tags: - - Incident Services - "x-permission": - operator: OR - permissions: - - incident_read - x-unstable: |- - **Note**: This endpoint is deprecated. - patch: - deprecated: true - description: >- - Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update. - operationId: UpdateIncidentService - parameters: - - $ref: "#/components/parameters/IncidentServiceIDPathParameter" - requestBody: - content: - application/json: - examples: - default: - value: - data: - attributes: - name: an example service name - id: 00000000-0000-0000-0000-000000000000 - relationships: - created_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - last_modified_by: - data: - id: 00000000-0000-0000-2345-000000000000 - type: users - type: services - schema: - $ref: "#/components/schemas/IncidentServiceUpdateRequest" - description: Incident Service Payload. - required: true - responses: - "200": - content: - application/json: - examples: - default: - value: - data: - attributes: - name: test-service - id: 00000000-0000-0000-0000-000000000003 - type: services - schema: - $ref: "#/components/schemas/IncidentServiceResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "401": - $ref: "#/components/responses/UnauthorizedResponse" - "403": - $ref: "#/components/responses/ForbiddenResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - incident_settings_write - summary: Update an existing incident service - tags: - - Incident Services - x-codegen-request-body-name: body - "x-permission": - operator: OR - permissions: - - incident_settings_write - x-unstable: |- - **Note**: This endpoint is deprecated. /api/v2/siem-historical-detections/histsignals: get: description: List hist signals. @@ -180352,6 +183003,559 @@ paths: operator: OR permissions: - synthetics_global_variable_write + /api/v2/tag-policies: + get: + description: |- + Retrieve all tag policies for the organization. Optionally include disabled or deleted + policies, filter by telemetry source, and include each policy's current compliance score + via the `include=score` query parameter. + operationId: ListTagPolicies + parameters: + - description: Whether to include policies that are currently disabled. Defaults to `false`. + example: false + in: query + name: include_disabled + required: false + schema: + type: boolean + - description: Whether to include policies that have been soft-deleted. Defaults to `false`. + example: false + in: query + name: include_deleted + required: false + schema: + type: boolean + - description: Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is `score`. + example: "score" + in: query + name: include + required: false + schema: + $ref: "#/components/schemas/TagPolicyInclude" + - description: Restrict the result set to policies whose source matches the given value. + in: query + name: filter[source] + required: false + schema: + $ref: "#/components/schemas/TagPolicySource" + - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source. + example: 1779315066097 + in: query + name: ts_start + required: false + schema: + format: int64 + type: integer + - description: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + example: 1779401466097 + in: query + name: ts_end + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + negated: false + policy_name: "Service tag must be one of api or web" + policy_type: "surfacing" + required: true + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + relationships: + score: + data: + id: "123-v1-1779315066097-1779401466097" + type: "tag_policy_score" + type: "tag_policy" + included: + - attributes: + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_policy_score" + schema: + $ref: "#/components/schemas/TagPoliciesListResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List tag policies + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: |- + Create a new tag policy for the organization. The caller's organization is derived from + the authenticated user; cross-organization creation is not supported. Fields such as + `policy_id`, `version`, and the timestamp/audit fields are assigned by the server. + operationId: CreateTagPolicy + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + negated: false + policy_name: "Service tag must be one of api or web" + policy_type: "surfacing" + required: true + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + type: "tag_policy" + schema: + $ref: "#/components/schemas/TagPolicyCreateRequest" + required: true + responses: + "201": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + negated: false + policy_name: "Service tag must be one of api or web" + policy_type: "surfacing" + required: true + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + type: "tag_policy" + schema: + $ref: "#/components/schemas/TagPolicyResponse" + description: Created + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "409": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Conflict + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create a tag policy + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/tag-policies/{policy_id}: + delete: + description: |- + Delete a tag policy. By default the policy is soft-deleted so it can be recovered later + and so that historical score data remains queryable. Pass `hard_delete=true` to remove + the policy permanently. + operationId: DeleteTagPolicy + parameters: + - description: The unique identifier of the tag policy to delete. + example: "123" + in: path + name: policy_id + required: true + schema: + type: string + - description: Whether to permanently delete the policy instead of performing a soft delete. Defaults to `false`. + example: false + in: query + name: hard_delete + required: false + schema: + type: boolean + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete a tag policy + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: |- + Retrieve a single tag policy by ID. Optionally include the policy's current compliance + score via the `include=score` query parameter. Policies belonging to other organizations + cannot be retrieved. + operationId: GetTagPolicy + parameters: + - description: The unique identifier of the tag policy. + example: "123" + in: path + name: policy_id + required: true + schema: + type: string + - description: Comma-separated list of related resources to include alongside the policy. Currently the only supported value is `score`. + example: "score" + in: query + name: include + required: false + schema: + $ref: "#/components/schemas/TagPolicyInclude" + - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + example: 1779315066097 + in: query + name: ts_start + required: false + schema: + format: int64 + type: integer + - description: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + example: 1779401466097 + in: query + name: ts_end + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:11:06.108696Z" + modified_by: "test-user" + negated: false + policy_name: "Service tag must be one of api or web" + policy_type: "surfacing" + required: true + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 1 + id: "123" + relationships: + score: + data: + id: "123-v1-1779315066097-1779401466097" + type: "tag_policy_score" + type: "tag_policy" + included: + - attributes: + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_policy_score" + schema: + $ref: "#/components/schemas/TagPolicyResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a tag policy + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + patch: + description: |- + Update one or more attributes of an existing tag policy. Only the fields supplied in the + request body are modified; omitted fields retain their current values. The policy's + `source` cannot be changed after creation. + operationId: UpdateTagPolicy + parameters: + - description: The unique identifier of the tag policy to update. + example: "123" + in: path + name: policy_id + required: true + schema: + type: string + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + enabled: true + policy_name: "Service tag must be one of api, web, or worker" + id: "123" + type: "tag_policy" + schema: + $ref: "#/components/schemas/TagPolicyUpdateRequest" + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + created_at: "2026-05-21T22:11:06.108696Z" + created_by: "test-user" + enabled: true + modified_at: "2026-05-21T22:25:01.000000Z" + modified_by: "test-user" + negated: false + policy_name: "Service tag must be one of api, web, or worker" + policy_type: "surfacing" + required: true + scope: "env" + source: "logs" + tag_key: "service" + tag_value_patterns: + - "api" + - "web" + version: 2 + id: "123" + type: "tag_policy" + schema: + $ref: "#/components/schemas/TagPolicyResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Update a tag policy + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/tag-policies/{policy_id}/score: + get: + description: |- + Retrieve the compliance score for a single tag policy. The score is computed over the + requested time window (or a source-appropriate default) and represents the percentage of + telemetry within that window that conforms to the policy. A `null` score indicates that + no relevant telemetry was found. + operationId: GetTagPolicyScore + parameters: + - description: The unique identifier of the tag policy. + example: "123" + in: path + name: policy_id + required: true + schema: + type: string + - description: Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + example: 1779315066097 + in: query + name: ts_start + required: false + schema: + format: int64 + type: integer + - description: End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + example: 1779401466097 + in: query + name: ts_end + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + score: 80 + ts_end: 1779401466097 + ts_start: 1779315066097 + version: 1 + id: "123-v1-1779315066097-1779401466097" + type: "tag_policy_score" + schema: + $ref: "#/components/schemas/TagPolicyScoreResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get a tag policy compliance score + tags: + - Tag Policies + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/tags/enrichment: get: description: List all tag pipeline rulesets - Retrieve a list of all tag pipeline rulesets for the organization @@ -185916,6 +189120,8 @@ tags: - description: |- The Data Deletion API allows the user to target and delete data from the allowed products. It's currently enabled for Logs and RUM and depends on `logs_delete_data` and `rum_delete_data` permissions respectively. name: Data Deletion + - description: Manage and run data observability monitors. + name: Data Observability - description: |- Data Access Controls in Datadog is a feature that allows administrators and access managers to regulate access to sensitive data. By defining Restricted Datasets, you can ensure that only specific teams or roles can @@ -185997,8 +189203,6 @@ tags: This is an enterprise-only feature. Request access by contacting Datadog support, or see the [IP Allowlist page](https://docs.datadoghq.com/account_management/org_settings/ip_allowlist/) for more information. name: IP Allowlist - - description: Create, update, delete, and retrieve services which can be associated with incidents. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. - name: Incident Services - description: Manage incident response, as well as associated attachments, metadata, and todos. See the [Incident Management page](https://docs.datadoghq.com/service_management/incident_management/) for more information. name: Incidents - description: |- @@ -186186,9 +189390,6 @@ tags: - description: |- Get insights into the performance of your Real User Monitoring (RUM) applications over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM Insights - - description: |- - Manage hardcoded retention filters through [Manage Applications](https://app.datadoghq.com/rum/list) in RUM. - name: RUM Retention Filters Hardcoded - description: View and manage Reference Tables in your organization. name: Reference Tables - description: |- @@ -186271,6 +189472,13 @@ tags: name: Service Level Objectives - description: Manage your ServiceNow Integration. ServiceNow is a cloud-based platform that helps organizations manage digital workflows for enterprise operations. name: ServiceNow Integration + - description: |- + Configure your [Datadog Slack integration](https://docs.datadoghq.com/integrations/slack/) + directly through the Datadog API. + externalDocs: + description: For more information about the Datadog Slack integration, see the integration page. + url: https://docs.datadoghq.com/integrations/slack/ + name: Slack Integration - description: |- API to create, update, retrieve, and delete Software Catalog entities. externalDocs: @@ -186311,6 +189519,13 @@ tags: You can use the Datadog API to create, manage, and organize tests and test suites programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). name: Synthetics + - description: |- + Tag Policies define rules that govern which tag values are accepted for a given tag key, + scoped to a particular telemetry source (such as logs, spans, or metrics). Policies can be + `blocking` (data not matching the policy is rejected) or `surfacing` (matching data is + highlighted but not blocked). Each policy reports a compliance `score` derived from how + much recent telemetry adheres to the policy. + name: Tag Policies - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams - description: |- diff --git a/examples/v2_google-chat-integration_CreateGoogleChatTargetAudience.rs b/examples/v2_google-chat-integration_CreateGoogleChatTargetAudience.rs new file mode 100644 index 0000000000..2ee823ed55 --- /dev/null +++ b/examples/v2_google-chat-integration_CreateGoogleChatTargetAudience.rs @@ -0,0 +1,29 @@ +// Create a target audience returns "CREATED" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceCreateRequest; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceCreateRequestAttributes; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceCreateRequestData; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceType; + +#[tokio::main] +async fn main() { + let body = + GoogleChatTargetAudienceCreateRequest::new(GoogleChatTargetAudienceCreateRequestData::new( + GoogleChatTargetAudienceCreateRequestAttributes::new( + "fake-audience-id-1".to_string(), + "fake audience name 1".to_string(), + ), + GoogleChatTargetAudienceType::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + )); + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .create_google_chat_target_audience("organization_binding_id".to_string(), body) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_DeleteGoogleChatDelegatedUser.rs b/examples/v2_google-chat-integration_DeleteGoogleChatDelegatedUser.rs new file mode 100644 index 0000000000..b45df511a2 --- /dev/null +++ b/examples/v2_google-chat-integration_DeleteGoogleChatDelegatedUser.rs @@ -0,0 +1,17 @@ +// Delete the delegated user returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .delete_google_chat_delegated_user("organization_binding_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_DeleteGoogleChatOrganization.rs b/examples/v2_google-chat-integration_DeleteGoogleChatOrganization.rs new file mode 100644 index 0000000000..f38a1ffe3f --- /dev/null +++ b/examples/v2_google-chat-integration_DeleteGoogleChatOrganization.rs @@ -0,0 +1,17 @@ +// Delete a Google Chat organization binding returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .delete_google_chat_organization("organization_binding_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_DeleteGoogleChatTargetAudience.rs b/examples/v2_google-chat-integration_DeleteGoogleChatTargetAudience.rs new file mode 100644 index 0000000000..37cdffb357 --- /dev/null +++ b/examples/v2_google-chat-integration_DeleteGoogleChatTargetAudience.rs @@ -0,0 +1,20 @@ +// Delete a target audience returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .delete_google_chat_target_audience( + "organization_binding_id".to_string(), + "target_audience_id".to_string(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_GetGoogleChatDelegatedUser.rs b/examples/v2_google-chat-integration_GetGoogleChatDelegatedUser.rs new file mode 100644 index 0000000000..cbd38be45d --- /dev/null +++ b/examples/v2_google-chat-integration_GetGoogleChatDelegatedUser.rs @@ -0,0 +1,17 @@ +// Get the delegated user returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .get_google_chat_delegated_user("organization_binding_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_GetGoogleChatOrganization.rs b/examples/v2_google-chat-integration_GetGoogleChatOrganization.rs new file mode 100644 index 0000000000..1d65c718db --- /dev/null +++ b/examples/v2_google-chat-integration_GetGoogleChatOrganization.rs @@ -0,0 +1,17 @@ +// Get a Google Chat organization binding returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .get_google_chat_organization("organization_binding_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_GetGoogleChatTargetAudience.rs b/examples/v2_google-chat-integration_GetGoogleChatTargetAudience.rs new file mode 100644 index 0000000000..f9b50f749c --- /dev/null +++ b/examples/v2_google-chat-integration_GetGoogleChatTargetAudience.rs @@ -0,0 +1,20 @@ +// Get a target audience returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .get_google_chat_target_audience( + "organization_binding_id".to_string(), + "target_audience_id".to_string(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_ListGoogleChatOrganizations.rs b/examples/v2_google-chat-integration_ListGoogleChatOrganizations.rs new file mode 100644 index 0000000000..07b5092c79 --- /dev/null +++ b/examples/v2_google-chat-integration_ListGoogleChatOrganizations.rs @@ -0,0 +1,15 @@ +// Get all Google Chat organization bindings returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api.list_google_chat_organizations().await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_ListGoogleChatTargetAudiences.rs b/examples/v2_google-chat-integration_ListGoogleChatTargetAudiences.rs new file mode 100644 index 0000000000..f09755f2ea --- /dev/null +++ b/examples/v2_google-chat-integration_ListGoogleChatTargetAudiences.rs @@ -0,0 +1,17 @@ +// Get all target audiences returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .list_google_chat_target_audiences("organization_binding_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_google-chat-integration_UpdateGoogleChatTargetAudience.rs b/examples/v2_google-chat-integration_UpdateGoogleChatTargetAudience.rs new file mode 100644 index 0000000000..7009876624 --- /dev/null +++ b/examples/v2_google-chat-integration_UpdateGoogleChatTargetAudience.rs @@ -0,0 +1,32 @@ +// Update a target audience returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_google_chat_integration::GoogleChatIntegrationAPI; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceType; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceUpdateRequest; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceUpdateRequestAttributes; +use datadog_api_client::datadogV2::model::GoogleChatTargetAudienceUpdateRequestData; + +#[tokio::main] +async fn main() { + let body = + GoogleChatTargetAudienceUpdateRequest::new(GoogleChatTargetAudienceUpdateRequestData::new( + GoogleChatTargetAudienceUpdateRequestAttributes::new() + .audience_id("fake-audience-id-1".to_string()) + .audience_name("fake audience name 1".to_string()), + GoogleChatTargetAudienceType::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + )); + let configuration = datadog::Configuration::new(); + let api = GoogleChatIntegrationAPI::with_config(configuration); + let resp = api + .update_google_chat_target_audience( + "organization_binding_id".to_string(), + "target_audience_id".to_string(), + body, + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_incident-services_CreateIncidentService.rs b/examples/v2_incident-services_CreateIncidentService.rs deleted file mode 100644 index 64ae8abce8..0000000000 --- a/examples/v2_incident-services_CreateIncidentService.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Create a new incident service returns "CREATED" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; -use datadog_api_client::datadogV2::model::IncidentServiceCreateAttributes; -use datadog_api_client::datadogV2::model::IncidentServiceCreateData; -use datadog_api_client::datadogV2::model::IncidentServiceCreateRequest; -use datadog_api_client::datadogV2::model::IncidentServiceType; - -#[tokio::main] -async fn main() { - let body = IncidentServiceCreateRequest::new( - IncidentServiceCreateData::new(IncidentServiceType::SERVICES).attributes( - IncidentServiceCreateAttributes::new("Example-Incident-Service".to_string()), - ), - ); - let mut configuration = datadog::Configuration::new(); - configuration.set_unstable_operation_enabled("v2.CreateIncidentService", true); - let api = IncidentServicesAPI::with_config(configuration); - let resp = api.create_incident_service(body).await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_incident-services_DeleteIncidentService.rs b/examples/v2_incident-services_DeleteIncidentService.rs deleted file mode 100644 index 696721e301..0000000000 --- a/examples/v2_incident-services_DeleteIncidentService.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Delete an existing incident service returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; - -#[tokio::main] -async fn main() { - // there is a valid "service" in the system - let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap(); - let mut configuration = datadog::Configuration::new(); - configuration.set_unstable_operation_enabled("v2.DeleteIncidentService", true); - let api = IncidentServicesAPI::with_config(configuration); - let resp = api.delete_incident_service(service_data_id.clone()).await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_incident-services_GetIncidentService.rs b/examples/v2_incident-services_GetIncidentService.rs deleted file mode 100644 index bc0dfd5bdf..0000000000 --- a/examples/v2_incident-services_GetIncidentService.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Get details of an incident service returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_incident_services::GetIncidentServiceOptionalParams; -use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; - -#[tokio::main] -async fn main() { - // there is a valid "service" in the system - let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap(); - let mut configuration = datadog::Configuration::new(); - configuration.set_unstable_operation_enabled("v2.GetIncidentService", true); - let api = IncidentServicesAPI::with_config(configuration); - let resp = api - .get_incident_service( - service_data_id.clone(), - GetIncidentServiceOptionalParams::default(), - ) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_incident-services_ListIncidentServices.rs b/examples/v2_incident-services_ListIncidentServices.rs deleted file mode 100644 index ae99642fa9..0000000000 --- a/examples/v2_incident-services_ListIncidentServices.rs +++ /dev/null @@ -1,24 +0,0 @@ -// Get a list of all incident services returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; -use datadog_api_client::datadogV2::api_incident_services::ListIncidentServicesOptionalParams; - -#[tokio::main] -async fn main() { - // there is a valid "service" in the system - let service_data_attributes_name = std::env::var("SERVICE_DATA_ATTRIBUTES_NAME").unwrap(); - let mut configuration = datadog::Configuration::new(); - configuration.set_unstable_operation_enabled("v2.ListIncidentServices", true); - let api = IncidentServicesAPI::with_config(configuration); - let resp = api - .list_incident_services( - ListIncidentServicesOptionalParams::default() - .filter(service_data_attributes_name.clone()), - ) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_incident-services_UpdateIncidentService.rs b/examples/v2_incident-services_UpdateIncidentService.rs deleted file mode 100644 index 196227a630..0000000000 --- a/examples/v2_incident-services_UpdateIncidentService.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Update an existing incident service returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_incident_services::IncidentServicesAPI; -use datadog_api_client::datadogV2::model::IncidentServiceType; -use datadog_api_client::datadogV2::model::IncidentServiceUpdateAttributes; -use datadog_api_client::datadogV2::model::IncidentServiceUpdateData; -use datadog_api_client::datadogV2::model::IncidentServiceUpdateRequest; - -#[tokio::main] -async fn main() { - // there is a valid "service" in the system - let service_data_id = std::env::var("SERVICE_DATA_ID").unwrap(); - let body = IncidentServiceUpdateRequest::new( - IncidentServiceUpdateData::new(IncidentServiceType::SERVICES).attributes( - IncidentServiceUpdateAttributes::new("service name-updated".to_string()), - ), - ); - let mut configuration = datadog::Configuration::new(); - configuration.set_unstable_operation_enabled("v2.UpdateIncidentService", true); - let api = IncidentServicesAPI::with_config(configuration); - let resp = api - .update_incident_service(service_data_id.clone(), body) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_llm-observability_DeleteLLMObsPatternsConfig.rs b/examples/v2_llm-observability_DeleteLLMObsPatternsConfig.rs new file mode 100644 index 0000000000..7dc79b9e34 --- /dev/null +++ b/examples/v2_llm-observability_DeleteLLMObsPatternsConfig.rs @@ -0,0 +1,18 @@ +// Delete a patterns configuration returns "No Content" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.DeleteLLMObsPatternsConfig", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .delete_llm_obs_patterns_config("config_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_GetLLMObsPatternsConfig.rs b/examples/v2_llm-observability_GetLLMObsPatternsConfig.rs new file mode 100644 index 0000000000..cf1c77ca08 --- /dev/null +++ b/examples/v2_llm-observability_GetLLMObsPatternsConfig.rs @@ -0,0 +1,16 @@ +// Get a patterns configuration returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.GetLLMObsPatternsConfig", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api.get_llm_obs_patterns_config().await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_GetLLMObsPatternsRunStatus.rs b/examples/v2_llm-observability_GetLLMObsPatternsRunStatus.rs new file mode 100644 index 0000000000..d9c2237d0b --- /dev/null +++ b/examples/v2_llm-observability_GetLLMObsPatternsRunStatus.rs @@ -0,0 +1,18 @@ +// Get patterns run status returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.GetLLMObsPatternsRunStatus", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .get_llm_obs_patterns_run_status("config_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_ListLLMObsPatternsClusteredPoints.rs b/examples/v2_llm-observability_ListLLMObsPatternsClusteredPoints.rs new file mode 100644 index 0000000000..1c213c5002 --- /dev/null +++ b/examples/v2_llm-observability_ListLLMObsPatternsClusteredPoints.rs @@ -0,0 +1,22 @@ +// List patterns clustered points returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; +use datadog_api_client::datadogV2::api_llm_observability::ListLLMObsPatternsClusteredPointsOptionalParams; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.ListLLMObsPatternsClusteredPoints", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .list_llm_obs_patterns_clustered_points( + "topic_id".to_string(), + ListLLMObsPatternsClusteredPointsOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_ListLLMObsPatternsConfigs.rs b/examples/v2_llm-observability_ListLLMObsPatternsConfigs.rs new file mode 100644 index 0000000000..9b1ba48c08 --- /dev/null +++ b/examples/v2_llm-observability_ListLLMObsPatternsConfigs.rs @@ -0,0 +1,16 @@ +// List patterns configurations returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.ListLLMObsPatternsConfigs", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api.list_llm_obs_patterns_configs().await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_ListLLMObsPatternsRuns.rs b/examples/v2_llm-observability_ListLLMObsPatternsRuns.rs new file mode 100644 index 0000000000..46e8c9630b --- /dev/null +++ b/examples/v2_llm-observability_ListLLMObsPatternsRuns.rs @@ -0,0 +1,18 @@ +// List patterns runs returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.ListLLMObsPatternsRuns", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .list_llm_obs_patterns_runs("config_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_ListLLMObsPatternsTopics.rs b/examples/v2_llm-observability_ListLLMObsPatternsTopics.rs new file mode 100644 index 0000000000..6d777e759a --- /dev/null +++ b/examples/v2_llm-observability_ListLLMObsPatternsTopics.rs @@ -0,0 +1,22 @@ +// List patterns topics returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; +use datadog_api_client::datadogV2::api_llm_observability::ListLLMObsPatternsTopicsOptionalParams; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.ListLLMObsPatternsTopics", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .list_llm_obs_patterns_topics( + "config_id".to_string(), + ListLLMObsPatternsTopicsOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_ListLLMObsPatternsTopicsWithClusteredPoints.rs b/examples/v2_llm-observability_ListLLMObsPatternsTopicsWithClusteredPoints.rs new file mode 100644 index 0000000000..00d7696142 --- /dev/null +++ b/examples/v2_llm-observability_ListLLMObsPatternsTopicsWithClusteredPoints.rs @@ -0,0 +1,23 @@ +// List patterns topics with clustered points returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; +use datadog_api_client::datadogV2::api_llm_observability::ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration + .set_unstable_operation_enabled("v2.ListLLMObsPatternsTopicsWithClusteredPoints", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api + .list_llm_obs_patterns_topics_with_clustered_points( + "config_id".to_string(), + ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_TriggerLLMObsPatterns.rs b/examples/v2_llm-observability_TriggerLLMObsPatterns.rs new file mode 100644 index 0000000000..d219ee6948 --- /dev/null +++ b/examples/v2_llm-observability_TriggerLLMObsPatterns.rs @@ -0,0 +1,26 @@ +// Trigger a patterns run returns "Accepted" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; +use datadog_api_client::datadogV2::model::LLMObsPatternsRequestType; +use datadog_api_client::datadogV2::model::LLMObsPatternsTriggerRequest; +use datadog_api_client::datadogV2::model::LLMObsPatternsTriggerRequestAttributes; +use datadog_api_client::datadogV2::model::LLMObsPatternsTriggerRequestData; + +#[tokio::main] +async fn main() { + let body = LLMObsPatternsTriggerRequest::new(LLMObsPatternsTriggerRequestData::new( + LLMObsPatternsTriggerRequestAttributes::new( + "a7c8d9e0-1234-5678-9abc-def012345678".to_string(), + ), + LLMObsPatternsRequestType::TOPIC_DISCOVERY, + )); + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.TriggerLLMObsPatterns", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api.trigger_llm_obs_patterns(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_llm-observability_UpsertLLMObsPatternsConfig.rs b/examples/v2_llm-observability_UpsertLLMObsPatternsConfig.rs new file mode 100644 index 0000000000..a3788cdee5 --- /dev/null +++ b/examples/v2_llm-observability_UpsertLLMObsPatternsConfig.rs @@ -0,0 +1,36 @@ +// Create or update a patterns configuration returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_llm_observability::LLMObservabilityAPI; +use datadog_api_client::datadogV2::model::LLMObsPatternsConfigType; +use datadog_api_client::datadogV2::model::LLMObsPatternsConfigUpsertRequest; +use datadog_api_client::datadogV2::model::LLMObsPatternsConfigUpsertRequestAttributes; +use datadog_api_client::datadogV2::model::LLMObsPatternsConfigUpsertRequestData; + +#[tokio::main] +async fn main() { + let body = LLMObsPatternsConfigUpsertRequest::new(LLMObsPatternsConfigUpsertRequestData::new( + LLMObsPatternsConfigUpsertRequestAttributes::new( + "@ml_app:support-bot".to_string(), + 2, + "Support chatbot topics".to_string(), + 1000, + 0.1, + ) + .account_id("1000000001".to_string()) + .config_id("a7c8d9e0-1234-5678-9abc-def012345678".to_string()) + .integration_provider("openai".to_string()) + .model_name("gpt-4o".to_string()) + .scope("".to_string()) + .template("".to_string()), + LLMObsPatternsConfigType::TOPIC_DISCOVERY_CONFIGS, + )); + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.UpsertLLMObsPatternsConfig", true); + let api = LLMObservabilityAPI::with_config(configuration); + let resp = api.upsert_llm_obs_patterns_config(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_microsoft-teams-integration_DeleteMSTeamsUserBinding.rs b/examples/v2_microsoft-teams-integration_DeleteMSTeamsUserBinding.rs new file mode 100644 index 0000000000..c2ce5019c2 --- /dev/null +++ b/examples/v2_microsoft-teams-integration_DeleteMSTeamsUserBinding.rs @@ -0,0 +1,17 @@ +// Delete user binding returns "No Content" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_microsoft_teams_integration::MicrosoftTeamsIntegrationAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = MicrosoftTeamsIntegrationAPI::with_config(configuration); + let resp = api + .delete_ms_teams_user_binding("tenant_id".to_string()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_organizations_ListGlobalOrgs.rs b/examples/v2_organizations_ListGlobalOrgs.rs new file mode 100644 index 0000000000..995895f623 --- /dev/null +++ b/examples/v2_organizations_ListGlobalOrgs.rs @@ -0,0 +1,21 @@ +// List global orgs returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_organizations::ListGlobalOrgsOptionalParams; +use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = OrganizationsAPI::with_config(configuration); + let resp = api + .list_global_orgs( + "user@example.com".to_string(), + ListGlobalOrgsOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_organizations_ListGlobalOrgs_465966063.rs b/examples/v2_organizations_ListGlobalOrgs_465966063.rs new file mode 100644 index 0000000000..66a012ac1f --- /dev/null +++ b/examples/v2_organizations_ListGlobalOrgs_465966063.rs @@ -0,0 +1,24 @@ +// List global orgs returns "OK" response with pagination +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_organizations::ListGlobalOrgsOptionalParams; +use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI; +use futures_util::pin_mut; +use futures_util::stream::StreamExt; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = OrganizationsAPI::with_config(configuration); + let response = api.list_global_orgs_with_pagination( + "user@example.com".to_string(), + ListGlobalOrgsOptionalParams::default(), + ); + pin_mut!(response); + while let Some(resp) = response.next().await { + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } + } +} diff --git a/examples/v2_organizations_UpdateLoginOrgConfigsMaxSessionDuration.rs b/examples/v2_organizations_UpdateLoginOrgConfigsMaxSessionDuration.rs new file mode 100644 index 0000000000..7d28555f8f --- /dev/null +++ b/examples/v2_organizations_UpdateLoginOrgConfigsMaxSessionDuration.rs @@ -0,0 +1,25 @@ +// Update the maximum session duration returns "No Content" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_organizations::OrganizationsAPI; +use datadog_api_client::datadogV2::model::MaxSessionDurationType; +use datadog_api_client::datadogV2::model::MaxSessionDurationUpdateAttributes; +use datadog_api_client::datadogV2::model::MaxSessionDurationUpdateData; +use datadog_api_client::datadogV2::model::MaxSessionDurationUpdateRequest; + +#[tokio::main] +async fn main() { + let body = MaxSessionDurationUpdateRequest::new(MaxSessionDurationUpdateData::new( + MaxSessionDurationUpdateAttributes::new(604800), + MaxSessionDurationType::MAX_SESSION_DURATION, + )); + let configuration = datadog::Configuration::new(); + let api = OrganizationsAPI::with_config(configuration); + let resp = api + .update_login_org_configs_max_session_duration(body) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_rum-retention-filters-hardcoded_GetHardcodedRetentionFilter.rs b/examples/v2_rum-retention-filters-hardcoded_GetHardcodedRetentionFilter.rs deleted file mode 100644 index c0f0f79e87..0000000000 --- a/examples/v2_rum-retention-filters-hardcoded_GetHardcodedRetentionFilter.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Get a hardcoded retention filter returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_rum_retention_filters_hardcoded::RUMRetentionFiltersHardcodedAPI; - -#[tokio::main] -async fn main() { - let configuration = datadog::Configuration::new(); - let api = RUMRetentionFiltersHardcodedAPI::with_config(configuration); - let resp = api - .get_hardcoded_retention_filter( - "Example-RUM-Retention-Filters-Hardcoded".to_string(), - "Example-RUM-Retention-Filters-Hardcoded".to_string(), - ) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_rum-retention-filters-hardcoded_ListHardcodedRetentionFilters.rs b/examples/v2_rum-retention-filters-hardcoded_ListHardcodedRetentionFilters.rs deleted file mode 100644 index 393a4cb6e5..0000000000 --- a/examples/v2_rum-retention-filters-hardcoded_ListHardcodedRetentionFilters.rs +++ /dev/null @@ -1,17 +0,0 @@ -// Get all hardcoded retention filters returns "OK" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_rum_retention_filters_hardcoded::RUMRetentionFiltersHardcodedAPI; - -#[tokio::main] -async fn main() { - let configuration = datadog::Configuration::new(); - let api = RUMRetentionFiltersHardcodedAPI::with_config(configuration); - let resp = api - .list_hardcoded_retention_filters("Example-RUM-Retention-Filters-Hardcoded".to_string()) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_rum-retention-filters-hardcoded_UpdateHardcodedRetentionFilter.rs b/examples/v2_rum-retention-filters-hardcoded_UpdateHardcodedRetentionFilter.rs deleted file mode 100644 index 41e05f4d6b..0000000000 --- a/examples/v2_rum-retention-filters-hardcoded_UpdateHardcodedRetentionFilter.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Update a hardcoded retention filter returns "Updated" response -use datadog_api_client::datadog; -use datadog_api_client::datadogV2::api_rum_retention_filters_hardcoded::RUMRetentionFiltersHardcodedAPI; -use datadog_api_client::datadogV2::model::RumHardcodedCrossProductSamplingUpdate; -use datadog_api_client::datadogV2::model::RumHardcodedRetentionFilterType; -use datadog_api_client::datadogV2::model::RumHardcodedRetentionFilterUpdateAttributes; -use datadog_api_client::datadogV2::model::RumHardcodedRetentionFilterUpdateData; -use datadog_api_client::datadogV2::model::RumHardcodedRetentionFilterUpdateRequest; - -#[tokio::main] -async fn main() { - let body = - RumHardcodedRetentionFilterUpdateRequest::new(RumHardcodedRetentionFilterUpdateData::new( - RumHardcodedRetentionFilterUpdateAttributes::new().cross_product_sampling( - RumHardcodedCrossProductSamplingUpdate::new() - .session_replay_enabled(true) - .session_replay_sample_rate(50.0 as f64), - ), - "REPLACE.ME".to_string(), - RumHardcodedRetentionFilterType::HARDCODED_RETENTION_FILTERS, - )); - let configuration = datadog::Configuration::new(); - let api = RUMRetentionFiltersHardcodedAPI::with_config(configuration); - let resp = api - .update_hardcoded_retention_filter( - "Example-RUM-Retention-Filters-Hardcoded".to_string(), - "Example-RUM-Retention-Filters-Hardcoded".to_string(), - body, - ) - .await; - if let Ok(value) = resp { - println!("{:#?}", value); - } else { - println!("{:#?}", resp.unwrap_err()); - } -} diff --git a/examples/v2_security-monitoring_RestoreSecurityMonitoringRule.rs b/examples/v2_security-monitoring_RestoreSecurityMonitoringRule.rs new file mode 100644 index 0000000000..fadb505a30 --- /dev/null +++ b/examples/v2_security-monitoring_RestoreSecurityMonitoringRule.rs @@ -0,0 +1,20 @@ +// Restore a rule to a historical version returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_security_monitoring::SecurityMonitoringAPI; + +#[tokio::main] +async fn main() { + // there is a valid "security_rule" in the system + let security_rule_id = std::env::var("SECURITY_RULE_ID").unwrap(); + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.RestoreSecurityMonitoringRule", true); + let api = SecurityMonitoringAPI::with_config(configuration); + let resp = api + .restore_security_monitoring_rule(security_rule_id.clone(), 1) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_slack-integration_ListSlackUserBindings.rs b/examples/v2_slack-integration_ListSlackUserBindings.rs new file mode 100644 index 0000000000..5077f3037f --- /dev/null +++ b/examples/v2_slack-integration_ListSlackUserBindings.rs @@ -0,0 +1,20 @@ +// List Slack user bindings returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_slack_integration::SlackIntegrationAPI; +use uuid::Uuid; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = SlackIntegrationAPI::with_config(configuration); + let resp = api + .list_slack_user_bindings( + Uuid::parse_str("00000000-0000-0000-0000-000000000000").expect("invalid UUID"), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_CreateTagPolicy.rs b/examples/v2_tag-policies_CreateTagPolicy.rs new file mode 100644 index 0000000000..74779fdb61 --- /dev/null +++ b/examples/v2_tag-policies_CreateTagPolicy.rs @@ -0,0 +1,36 @@ +// Create a tag policy returns "Created" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; +use datadog_api_client::datadogV2::model::TagPolicyCreateAttributes; +use datadog_api_client::datadogV2::model::TagPolicyCreateData; +use datadog_api_client::datadogV2::model::TagPolicyCreateRequest; +use datadog_api_client::datadogV2::model::TagPolicyCreateType; +use datadog_api_client::datadogV2::model::TagPolicyResourceType; +use datadog_api_client::datadogV2::model::TagPolicySource; + +#[tokio::main] +async fn main() { + let body = TagPolicyCreateRequest::new(TagPolicyCreateData::new( + TagPolicyCreateAttributes::new( + "Service tag must be one of api or web".to_string(), + TagPolicyCreateType::SURFACING, + "env".to_string(), + TagPolicySource::LOGS, + "service".to_string(), + vec!["api".to_string(), "web".to_string()], + ) + .enabled(true) + .negated(false) + .required(true), + TagPolicyResourceType::TAG_POLICY, + )); + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.CreateTagPolicy", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api.create_tag_policy(body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_DeleteTagPolicy.rs b/examples/v2_tag-policies_DeleteTagPolicy.rs new file mode 100644 index 0000000000..61aa79513e --- /dev/null +++ b/examples/v2_tag-policies_DeleteTagPolicy.rs @@ -0,0 +1,22 @@ +// Delete a tag policy returns "No Content" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::DeleteTagPolicyOptionalParams; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.DeleteTagPolicy", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api + .delete_tag_policy( + "policy_id".to_string(), + DeleteTagPolicyOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_GetTagPolicy.rs b/examples/v2_tag-policies_GetTagPolicy.rs new file mode 100644 index 0000000000..239948dd93 --- /dev/null +++ b/examples/v2_tag-policies_GetTagPolicy.rs @@ -0,0 +1,22 @@ +// Get a tag policy returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::GetTagPolicyOptionalParams; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.GetTagPolicy", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api + .get_tag_policy( + "policy_id".to_string(), + GetTagPolicyOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_GetTagPolicyScore.rs b/examples/v2_tag-policies_GetTagPolicyScore.rs new file mode 100644 index 0000000000..e410463667 --- /dev/null +++ b/examples/v2_tag-policies_GetTagPolicyScore.rs @@ -0,0 +1,22 @@ +// Get a tag policy compliance score returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::GetTagPolicyScoreOptionalParams; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.GetTagPolicyScore", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api + .get_tag_policy_score( + "policy_id".to_string(), + GetTagPolicyScoreOptionalParams::default(), + ) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_ListTagPolicies.rs b/examples/v2_tag-policies_ListTagPolicies.rs new file mode 100644 index 0000000000..8c86a13421 --- /dev/null +++ b/examples/v2_tag-policies_ListTagPolicies.rs @@ -0,0 +1,19 @@ +// List tag policies returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::ListTagPoliciesOptionalParams; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; + +#[tokio::main] +async fn main() { + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.ListTagPolicies", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api + .list_tag_policies(ListTagPoliciesOptionalParams::default()) + .await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/examples/v2_tag-policies_UpdateTagPolicy.rs b/examples/v2_tag-policies_UpdateTagPolicy.rs new file mode 100644 index 0000000000..10f7335d41 --- /dev/null +++ b/examples/v2_tag-policies_UpdateTagPolicy.rs @@ -0,0 +1,28 @@ +// Update a tag policy returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_tag_policies::TagPoliciesAPI; +use datadog_api_client::datadogV2::model::TagPolicyResourceType; +use datadog_api_client::datadogV2::model::TagPolicyType; +use datadog_api_client::datadogV2::model::TagPolicyUpdateAttributes; +use datadog_api_client::datadogV2::model::TagPolicyUpdateData; +use datadog_api_client::datadogV2::model::TagPolicyUpdateRequest; + +#[tokio::main] +async fn main() { + let body = TagPolicyUpdateRequest::new( + TagPolicyUpdateData::new("123".to_string(), TagPolicyResourceType::TAG_POLICY).attributes( + TagPolicyUpdateAttributes::new() + .policy_type(TagPolicyType::SURFACING) + .tag_value_patterns(vec![]), + ), + ); + let mut configuration = datadog::Configuration::new(); + configuration.set_unstable_operation_enabled("v2.UpdateTagPolicy", true); + let api = TagPoliciesAPI::with_config(configuration); + let resp = api.update_tag_policy("policy_id".to_string(), body).await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/src/datadog/configuration.rs b/src/datadog/configuration.rs index 67945f9b52..9f7c50a773 100644 --- a/src/datadog/configuration.rs +++ b/src/datadog/configuration.rs @@ -163,6 +163,7 @@ impl Default for Configuration { ("v2.delete_llm_obs_dataset_records".to_owned(), false), ("v2.delete_llm_obs_datasets".to_owned(), false), ("v2.delete_llm_obs_experiments".to_owned(), false), + ("v2.delete_llm_obs_patterns_config".to_owned(), false), ("v2.delete_llm_obs_projects".to_owned(), false), ("v2.export_llm_obs_dataset".to_owned(), false), ("v2.get_llm_obs_annotated_interactions".to_owned(), false), @@ -176,6 +177,8 @@ impl Default for Configuration { ), ("v2.get_llm_obs_custom_eval_config".to_owned(), false), ("v2.get_llm_obs_dataset_draft_state".to_owned(), false), + ("v2.get_llm_obs_patterns_config".to_owned(), false), + ("v2.get_llm_obs_patterns_run_status".to_owned(), false), ("v2.list_llm_obs_annotation_queues".to_owned(), false), ("v2.list_llm_obs_dataset_records".to_owned(), false), ("v2.list_llm_obs_datasets".to_owned(), false), @@ -186,6 +189,17 @@ impl Default for Configuration { ("v2.list_llm_obs_experiments".to_owned(), false), ("v2.list_llm_obs_integration_accounts".to_owned(), false), ("v2.list_llm_obs_integration_models".to_owned(), false), + ( + "v2.list_llm_obs_patterns_clustered_points".to_owned(), + false, + ), + ("v2.list_llm_obs_patterns_configs".to_owned(), false), + ("v2.list_llm_obs_patterns_runs".to_owned(), false), + ("v2.list_llm_obs_patterns_topics".to_owned(), false), + ( + "v2.list_llm_obs_patterns_topics_with_clustered_points".to_owned(), + false, + ), ("v2.list_llm_obs_projects".to_owned(), false), ("v2.list_llm_obs_spans".to_owned(), false), ("v2.lock_llm_obs_dataset_draft_state".to_owned(), false), @@ -193,6 +207,7 @@ impl Default for Configuration { ("v2.search_llm_obs_experimentation".to_owned(), false), ("v2.search_llm_obs_spans".to_owned(), false), ("v2.simple_search_llm_obs_experimentation".to_owned(), false), + ("v2.trigger_llm_obs_patterns".to_owned(), false), ("v2.unlock_llm_obs_dataset_draft_state".to_owned(), false), ("v2.update_llm_obs_annotation_queue".to_owned(), false), ( @@ -206,6 +221,7 @@ impl Default for Configuration { ("v2.update_llm_obs_project".to_owned(), false), ("v2.upload_llm_obs_dataset_records_file".to_owned(), false), ("v2.upsert_llm_obs_annotations".to_owned(), false), + ("v2.upsert_llm_obs_patterns_config".to_owned(), false), ("v2.create_annotation".to_owned(), false), ("v2.delete_annotation".to_owned(), false), ("v2.get_page_annotations".to_owned(), false), @@ -374,6 +390,7 @@ impl Default for Configuration { ("v2.list_vulnerabilities".to_owned(), false), ("v2.list_vulnerable_assets".to_owned(), false), ("v2.mute_findings".to_owned(), false), + ("v2.restore_security_monitoring_rule".to_owned(), false), ("v2.run_historical_job".to_owned(), false), ( "v2.search_security_monitoring_histsignals".to_owned(), @@ -441,6 +458,11 @@ impl Default for Configuration { ("v2.update_dashboard_secure_embed".to_owned(), false), ("v2.get_dashboard_usage".to_owned(), false), ("v2.list_dashboards_usage".to_owned(), false), + ( + "v2.get_data_observability_monitor_run_status".to_owned(), + false, + ), + ("v2.run_data_observability_monitor".to_owned(), false), ("v2.create_dataset".to_owned(), false), ("v2.delete_dataset".to_owned(), false), ("v2.get_all_datasets".to_owned(), false), @@ -474,6 +496,7 @@ impl Default for Configuration { ("v2.update_form".to_owned(), false), ("v2.upsert_and_publish_form_version".to_owned(), false), ("v2.upsert_form_version".to_owned(), false), + ("v2.update_org_saml_configurations".to_owned(), false), ("v2.create_hamr_org_connection".to_owned(), false), ("v2.get_hamr_org_connection".to_owned(), false), ("v2.delete_entity_integration_config".to_owned(), false), @@ -589,7 +612,6 @@ impl Default for Configuration { ("v2.get_scopes_restriction".to_owned(), false), ("v2.register_o_auth_client".to_owned(), false), ("v2.upsert_scopes_restriction".to_owned(), false), - ("v2.update_org_saml_configurations".to_owned(), false), ("v2.disable_customer_org".to_owned(), false), ("v2.bulk_update_org_group_memberships".to_owned(), false), ("v2.create_org_group".to_owned(), false), @@ -640,11 +662,6 @@ impl Default for Configuration { ("v2.create_scorecard_outcomes_batch".to_owned(), false), ("v2.get_entity_risk_score".to_owned(), false), ("v2.list_entity_risk_scores".to_owned(), false), - ("v2.create_incident_service".to_owned(), false), - ("v2.delete_incident_service".to_owned(), false), - ("v2.get_incident_service".to_owned(), false), - ("v2.list_incident_services".to_owned(), false), - ("v2.update_incident_service".to_owned(), false), ("v2.create_slo_report_job".to_owned(), false), ("v2.get_slo_report".to_owned(), false), ("v2.get_slo_report_job_status".to_owned(), false), @@ -683,6 +700,12 @@ impl Default for Configuration { ("v2.revert_custom_rule_revision".to_owned(), false), ("v2.update_ai_custom_ruleset".to_owned(), false), ("v2.update_custom_ruleset".to_owned(), false), + ("v2.create_tag_policy".to_owned(), false), + ("v2.delete_tag_policy".to_owned(), false), + ("v2.get_tag_policy".to_owned(), false), + ("v2.get_tag_policy_score".to_owned(), false), + ("v2.list_tag_policies".to_owned(), false), + ("v2.update_tag_policy".to_owned(), false), ("v2.add_member_team".to_owned(), false), ("v2.list_member_teams".to_owned(), false), ("v2.remove_member_team".to_owned(), false), diff --git a/src/datadogV2/api/api_cloud_cost_management.rs b/src/datadogV2/api/api_cloud_cost_management.rs index bec4dc7d7e..9f35c8a9c5 100644 --- a/src/datadogV2/api/api_cloud_cost_management.rs +++ b/src/datadogV2/api/api_cloud_cost_management.rs @@ -348,6 +348,8 @@ impl ListCostTagDescriptionsOptionalParams { pub struct ListCostTagKeySourcesOptionalParams { /// Filter results to a specific provider. Common cloud values are `aws`, `azure`, `gcp`, `Oracle` (OCI), and `custom`. SaaS billing integrations (for example, `Snowflake`, `MongoDB`, `Databricks`) are also accepted using their display-name string. Values are case-sensitive. pub filter_provider: Option, + /// Filter results to tag keys that have data for a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, all tag keys for the requested period are returned. + pub filter_metric: Option, } impl ListCostTagKeySourcesOptionalParams { @@ -356,6 +358,11 @@ impl ListCostTagKeySourcesOptionalParams { self.filter_provider = Some(value); self } + /// Filter results to tag keys that have data for a specific Cloud Cost Management metric (for example, `aws.cost.net.amortized`). When omitted, all tag keys for the requested period are returned. + pub fn filter_metric(mut self, value: String) -> Self { + self.filter_metric = Some(value); + self + } } /// ListCostTagKeysOptionalParams is a struct for passing parameters to the method [`CloudCostManagementAPI::list_cost_tag_keys`] @@ -6090,6 +6097,7 @@ impl CloudCostManagementAPI { // unbox and build optional parameters let filter_provider = params.filter_provider; + let filter_metric = params.filter_metric; let local_client = &self.client; @@ -6106,6 +6114,10 @@ impl CloudCostManagementAPI { local_req_builder = local_req_builder.query(&[("filter[provider]", &local_query_param.to_string())]); }; + if let Some(ref local_query_param) = filter_metric { + local_req_builder = + local_req_builder.query(&[("filter[metric]", &local_query_param.to_string())]); + }; // build headers let mut headers = HeaderMap::new(); diff --git a/src/datadogV2/api/api_data_observability.rs b/src/datadogV2/api/api_data_observability.rs new file mode 100644 index 0000000000..198227eadb --- /dev/null +++ b/src/datadogV2/api/api_data_observability.rs @@ -0,0 +1,344 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use crate::datadog; +use log::warn; +use reqwest::header::{HeaderMap, HeaderValue}; +use serde::{Deserialize, Serialize}; + +/// GetDataObservabilityMonitorRunStatusError is a struct for typed errors of method [`DataObservabilityAPI::get_data_observability_monitor_run_status`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetDataObservabilityMonitorRunStatusError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// RunDataObservabilityMonitorError is a struct for typed errors of method [`DataObservabilityAPI::run_data_observability_monitor`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RunDataObservabilityMonitorError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// Manage and run data observability monitors. +#[derive(Debug, Clone)] +pub struct DataObservabilityAPI { + config: datadog::Configuration, + client: reqwest_middleware::ClientWithMiddleware, +} + +impl Default for DataObservabilityAPI { + fn default() -> Self { + Self::with_config(datadog::Configuration::default()) + } +} + +impl DataObservabilityAPI { + pub fn new() -> Self { + Self::default() + } + pub fn with_config(config: datadog::Configuration) -> Self { + let reqwest_client_builder = { + let builder = reqwest::Client::builder(); + #[cfg(not(target_arch = "wasm32"))] + let builder = if let Some(proxy_url) = &config.proxy_url { + builder.proxy(reqwest::Proxy::all(proxy_url).expect("Failed to parse proxy URL")) + } else { + builder + }; + builder + }; + + let middleware_client_builder = { + let builder = + reqwest_middleware::ClientBuilder::new(reqwest_client_builder.build().unwrap()); + #[cfg(feature = "retry")] + let builder = if config.enable_retry { + struct RetryableStatus; + impl reqwest_retry::RetryableStrategy for RetryableStatus { + fn handle( + &self, + res: &Result, + ) -> Option { + match res { + Ok(success) => reqwest_retry::default_on_request_success(success), + Err(_) => None, + } + } + } + let backoff_policy = reqwest_retry::policies::ExponentialBackoff::builder() + .build_with_max_retries(config.max_retries); + + let retry_middleware = + reqwest_retry::RetryTransientMiddleware::new_with_policy_and_strategy( + backoff_policy, + RetryableStatus, + ); + + builder.with(retry_middleware) + } else { + builder + }; + builder + }; + + let client = middleware_client_builder.build(); + + Self { config, client } + } + + pub fn with_client_and_config( + config: datadog::Configuration, + client: reqwest_middleware::ClientWithMiddleware, + ) -> Self { + Self { config, client } + } + + /// Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + pub async fn get_data_observability_monitor_run_status( + &self, + run_id: String, + ) -> Result< + crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponse, + datadog::Error, + > { + match self + .get_data_observability_monitor_run_status_with_http_info(run_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieves the current status of a data observability monitor run. Poll this endpoint after triggering a run to determine when evaluation is complete. + pub async fn get_data_observability_monitor_run_status_with_http_info( + &self, + run_id: String, + ) -> Result< + datadog::ResponseContent< + crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponse, + >, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_data_observability_monitor_run_status"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.get_data_observability_monitor_run_status' is not enabled" + .to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/data-observability/monitors/runs/{run_id}/status", + local_configuration.get_operation_host(operation_id), + run_id = datadog::urlencode(run_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::< + crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponse, + >(&local_content) + { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + pub async fn run_data_observability_monitor( + &self, + monitor_id: i64, + ) -> Result< + crate::datadogV2::model::RunDataObservabilityMonitorResponse, + datadog::Error, + > { + match self + .run_data_observability_monitor_with_http_info(monitor_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Manually triggers a run for a data observability monitor. Only monitors that are not scheduled (manually-runnable) can be triggered this way. + pub async fn run_data_observability_monitor_with_http_info( + &self, + monitor_id: i64, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.run_data_observability_monitor"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.run_data_observability_monitor' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/data-observability/monitors/{monitor_id}/run", + local_configuration.get_operation_host(operation_id), + monitor_id = monitor_id + ); + let mut local_req_builder = + local_client.request(reqwest::Method::POST, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } +} diff --git a/src/datadogV2/api/api_google_chat_integration.rs b/src/datadogV2/api/api_google_chat_integration.rs index 4c189531fc..177387c1fb 100644 --- a/src/datadogV2/api/api_google_chat_integration.rs +++ b/src/datadogV2/api/api_google_chat_integration.rs @@ -10,6 +10,14 @@ use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; +/// CreateGoogleChatTargetAudienceError is a struct for typed errors of method [`GoogleChatIntegrationAPI::create_google_chat_target_audience`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateGoogleChatTargetAudienceError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// CreateOrganizationHandleError is a struct for typed errors of method [`GoogleChatIntegrationAPI::create_organization_handle`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -18,6 +26,30 @@ pub enum CreateOrganizationHandleError { UnknownValue(serde_json::Value), } +/// DeleteGoogleChatDelegatedUserError is a struct for typed errors of method [`GoogleChatIntegrationAPI::delete_google_chat_delegated_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGoogleChatDelegatedUserError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// DeleteGoogleChatOrganizationError is a struct for typed errors of method [`GoogleChatIntegrationAPI::delete_google_chat_organization`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGoogleChatOrganizationError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// DeleteGoogleChatTargetAudienceError is a struct for typed errors of method [`GoogleChatIntegrationAPI::delete_google_chat_target_audience`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteGoogleChatTargetAudienceError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// DeleteOrganizationHandleError is a struct for typed errors of method [`GoogleChatIntegrationAPI::delete_organization_handle`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -26,6 +58,30 @@ pub enum DeleteOrganizationHandleError { UnknownValue(serde_json::Value), } +/// GetGoogleChatDelegatedUserError is a struct for typed errors of method [`GoogleChatIntegrationAPI::get_google_chat_delegated_user`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGoogleChatDelegatedUserError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// GetGoogleChatOrganizationError is a struct for typed errors of method [`GoogleChatIntegrationAPI::get_google_chat_organization`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGoogleChatOrganizationError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// GetGoogleChatTargetAudienceError is a struct for typed errors of method [`GoogleChatIntegrationAPI::get_google_chat_target_audience`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetGoogleChatTargetAudienceError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// GetOrganizationHandleError is a struct for typed errors of method [`GoogleChatIntegrationAPI::get_organization_handle`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -42,6 +98,22 @@ pub enum GetSpaceByDisplayNameError { UnknownValue(serde_json::Value), } +/// ListGoogleChatOrganizationsError is a struct for typed errors of method [`GoogleChatIntegrationAPI::list_google_chat_organizations`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGoogleChatOrganizationsError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// ListGoogleChatTargetAudiencesError is a struct for typed errors of method [`GoogleChatIntegrationAPI::list_google_chat_target_audiences`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGoogleChatTargetAudiencesError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// ListOrganizationHandlesError is a struct for typed errors of method [`GoogleChatIntegrationAPI::list_organization_handles`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -50,6 +122,14 @@ pub enum ListOrganizationHandlesError { UnknownValue(serde_json::Value), } +/// UpdateGoogleChatTargetAudienceError is a struct for typed errors of method [`GoogleChatIntegrationAPI::update_google_chat_target_audience`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateGoogleChatTargetAudienceError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// UpdateOrganizationHandleError is a struct for typed errors of method [`GoogleChatIntegrationAPI::update_organization_handle`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -133,6 +213,167 @@ impl GoogleChatIntegrationAPI { Self { config, client } } + /// Create a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn create_google_chat_target_audience( + &self, + organization_binding_id: String, + body: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequest, + ) -> Result< + crate::datadogV2::model::GoogleChatTargetAudienceResponse, + datadog::Error, + > { + match self + .create_google_chat_target_audience_with_http_info(organization_binding_id, body) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Create a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn create_google_chat_target_audience_with_http_info( + &self, + organization_binding_id: String, + body: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequest, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.create_google_chat_target_audience"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::POST, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Content-Type", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + // build body parameters + let output = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); + if body.serialize(&mut ser).is_ok() { + if let Some(content_encoding) = headers.get("Content-Encoding") { + match content_encoding.to_str().unwrap_or_default() { + "gzip" => { + let mut enc = GzEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + "deflate" => { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + #[cfg(feature = "zstd")] + "zstd1" => { + let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + _ => { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + } else { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Create an organization handle in the Datadog Google Chat integration. pub async fn create_organization_handle( &self, @@ -295,14 +536,13 @@ impl GoogleChatIntegrationAPI { } } - /// Delete an organization handle from the Datadog Google Chat integration. - pub async fn delete_organization_handle( + /// Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn delete_google_chat_delegated_user( &self, organization_binding_id: String, - handle_id: String, - ) -> Result<(), datadog::Error> { + ) -> Result<(), datadog::Error> { match self - .delete_organization_handle_with_http_info(organization_binding_id, handle_id) + .delete_google_chat_delegated_user_with_http_info(organization_binding_id) .await { Ok(_) => Ok(()), @@ -310,23 +550,21 @@ impl GoogleChatIntegrationAPI { } } - /// Delete an organization handle from the Datadog Google Chat integration. - pub async fn delete_organization_handle_with_http_info( + /// Delete the delegated user for a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn delete_google_chat_delegated_user_with_http_info( &self, organization_binding_id: String, - handle_id: String, - ) -> Result, datadog::Error> { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; - let operation_id = "v2.delete_organization_handle"; + let operation_id = "v2.delete_google_chat_delegated_user"; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user", local_configuration.get_operation_host(operation_id), organization_binding_id= datadog::urlencode(organization_binding_id) - , handle_id= - datadog::urlencode(handle_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); @@ -379,7 +617,7 @@ impl GoogleChatIntegrationAPI { entity: None, }) } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -390,59 +628,688 @@ impl GoogleChatIntegrationAPI { } } - /// Get an organization handle from the Datadog Google Chat integration. - pub async fn get_organization_handle( + /// Delete a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn delete_google_chat_organization( &self, organization_binding_id: String, - handle_id: String, - ) -> Result< - crate::datadogV2::model::GoogleChatOrganizationHandleResponse, - datadog::Error, - > { + ) -> Result<(), datadog::Error> { match self - .get_organization_handle_with_http_info(organization_binding_id, handle_id) + .delete_google_chat_organization_with_http_info(organization_binding_id) .await { - Ok(response_content) => { - if let Some(e) = response_content.entity { - Ok(e) - } else { - Err(datadog::Error::Serde(serde::de::Error::custom( - "response content was None", - ))) - } - } + Ok(_) => Ok(()), Err(err) => Err(err), } } - /// Get an organization handle from the Datadog Google Chat integration. - pub async fn get_organization_handle_with_http_info( + /// Delete a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn delete_google_chat_organization_with_http_info( &self, organization_binding_id: String, - handle_id: String, - ) -> Result< - datadog::ResponseContent, - datadog::Error, - > { + ) -> Result, datadog::Error> + { let local_configuration = &self.config; - let operation_id = "v2.get_organization_handle"; + let operation_id = "v2.delete_google_chat_organization"; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", - local_configuration.get_operation_host(operation_id), organization_binding_id= - datadog::urlencode(organization_binding_id) - , handle_id= - datadog::urlencode(handle_id) - ); + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}", + local_configuration.get_operation_host(operation_id), + organization_binding_id = datadog::urlencode(organization_binding_id) + ); let mut local_req_builder = - local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); // build headers let mut headers = HeaderMap::new(); - headers.insert("Accept", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Delete a target audience from a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn delete_google_chat_target_audience( + &self, + organization_binding_id: String, + target_audience_id: String, + ) -> Result<(), datadog::Error> { + match self + .delete_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + ) + .await + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + + /// Delete a target audience from a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn delete_google_chat_target_audience_with_http_info( + &self, + organization_binding_id: String, + target_audience_id: String, + ) -> Result, datadog::Error> + { + let local_configuration = &self.config; + let operation_id = "v2.delete_google_chat_target_audience"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + , target_audience_id= + datadog::urlencode(target_audience_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Delete an organization handle from the Datadog Google Chat integration. + pub async fn delete_organization_handle( + &self, + organization_binding_id: String, + handle_id: String, + ) -> Result<(), datadog::Error> { + match self + .delete_organization_handle_with_http_info(organization_binding_id, handle_id) + .await + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + + /// Delete an organization handle from the Datadog Google Chat integration. + pub async fn delete_organization_handle_with_http_info( + &self, + organization_binding_id: String, + handle_id: String, + ) -> Result, datadog::Error> { + let local_configuration = &self.config; + let operation_id = "v2.delete_organization_handle"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + , handle_id= + datadog::urlencode(handle_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get the delegated user for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn get_google_chat_delegated_user( + &self, + organization_binding_id: String, + ) -> Result< + crate::datadogV2::model::GoogleChatDelegatedUserResponse, + datadog::Error, + > { + match self + .get_google_chat_delegated_user_with_http_info(organization_binding_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get the delegated user for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn get_google_chat_delegated_user_with_http_info( + &self, + organization_binding_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_google_chat_delegated_user"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/delegated-user", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn get_google_chat_organization( + &self, + organization_binding_id: String, + ) -> Result< + crate::datadogV2::model::GoogleChatOrganizationResponse, + datadog::Error, + > { + match self + .get_google_chat_organization_with_http_info(organization_binding_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get a Google Chat organization binding from the Datadog Google Chat integration. + pub async fn get_google_chat_organization_with_http_info( + &self, + organization_binding_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_google_chat_organization"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}", + local_configuration.get_operation_host(operation_id), + organization_binding_id = datadog::urlencode(organization_binding_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn get_google_chat_target_audience( + &self, + organization_binding_id: String, + target_audience_id: String, + ) -> Result< + crate::datadogV2::model::GoogleChatTargetAudienceResponse, + datadog::Error, + > { + match self + .get_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + ) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn get_google_chat_target_audience_with_http_info( + &self, + organization_binding_id: String, + target_audience_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_google_chat_target_audience"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + , target_audience_id= + datadog::urlencode(target_audience_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get an organization handle from the Datadog Google Chat integration. + pub async fn get_organization_handle( + &self, + organization_binding_id: String, + handle_id: String, + ) -> Result< + crate::datadogV2::model::GoogleChatOrganizationHandleResponse, + datadog::Error, + > { + match self + .get_organization_handle_with_http_info(organization_binding_id, handle_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get an organization handle from the Datadog Google Chat integration. + pub async fn get_organization_handle_with_http_info( + &self, + organization_binding_id: String, + handle_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_organization_handle"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/organization-handles/{handle_id}", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + , handle_id= + datadog::urlencode(handle_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); // build user agent match HeaderValue::from_str(local_configuration.user_agent.as_str()) { @@ -496,7 +1363,229 @@ impl GoogleChatIntegrationAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. + pub async fn get_space_by_display_name( + &self, + domain_name: String, + space_display_name: String, + ) -> Result< + crate::datadogV2::model::GoogleChatAppNamedSpaceResponse, + datadog::Error, + > { + match self + .get_space_by_display_name_with_http_info(domain_name, space_display_name) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. + pub async fn get_space_by_display_name_with_http_info( + &self, + domain_name: String, + space_display_name: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_space_by_display_name"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}", + local_configuration.get_operation_host(operation_id), domain_name= + datadog::urlencode(domain_name) + , space_display_name= + datadog::urlencode(space_display_name) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + pub async fn list_google_chat_organizations( + &self, + ) -> Result< + crate::datadogV2::model::GoogleChatOrganizationsResponse, + datadog::Error, + > { + match self.list_google_chat_organizations_with_http_info().await { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Get a list of all Google Chat organization bindings in the Datadog Google Chat integration. + pub async fn list_google_chat_organizations_with_http_info( + &self, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_google_chat_organizations"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -507,17 +1596,16 @@ impl GoogleChatIntegrationAPI { } } - /// Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. - pub async fn get_space_by_display_name( + /// Get a list of all target audiences for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn list_google_chat_target_audiences( &self, - domain_name: String, - space_display_name: String, + organization_binding_id: String, ) -> Result< - crate::datadogV2::model::GoogleChatAppNamedSpaceResponse, - datadog::Error, + crate::datadogV2::model::GoogleChatTargetAudiencesResponse, + datadog::Error, > { match self - .get_space_by_display_name_with_http_info(domain_name, space_display_name) + .list_google_chat_target_audiences_with_http_info(organization_binding_id) .await { Ok(response_content) => { @@ -533,26 +1621,23 @@ impl GoogleChatIntegrationAPI { } } - /// Get the resource name and organization binding ID of a space in the Datadog Google Chat integration. - pub async fn get_space_by_display_name_with_http_info( + /// Get a list of all target audiences for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn list_google_chat_target_audiences_with_http_info( &self, - domain_name: String, - space_display_name: String, + organization_binding_id: String, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_space_by_display_name"; + let operation_id = "v2.list_google_chat_target_audiences"; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/integration/google-chat/organizations/app/named-spaces/{domain_name}/{space_display_name}", - local_configuration.get_operation_host(operation_id), domain_name= - datadog::urlencode(domain_name) - , space_display_name= - datadog::urlencode(space_display_name) + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); @@ -599,7 +1684,7 @@ impl GoogleChatIntegrationAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -612,7 +1697,7 @@ impl GoogleChatIntegrationAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -736,6 +1821,175 @@ impl GoogleChatIntegrationAPI { } } + /// Update a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn update_google_chat_target_audience( + &self, + organization_binding_id: String, + target_audience_id: String, + body: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequest, + ) -> Result< + crate::datadogV2::model::GoogleChatTargetAudienceResponse, + datadog::Error, + > { + match self + .update_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + body, + ) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Update a target audience for a Google Chat organization binding in the Datadog Google Chat integration. + pub async fn update_google_chat_target_audience_with_http_info( + &self, + organization_binding_id: String, + target_audience_id: String, + body: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequest, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.update_google_chat_target_audience"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/google-chat/organizations/{organization_binding_id}/target-audiences/{target_audience_id}", + local_configuration.get_operation_host(operation_id), organization_binding_id= + datadog::urlencode(organization_binding_id) + , target_audience_id= + datadog::urlencode(target_audience_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Content-Type", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + // build body parameters + let output = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); + if body.serialize(&mut ser).is_ok() { + if let Some(content_encoding) = headers.get("Content-Encoding") { + match content_encoding.to_str().unwrap_or_default() { + "gzip" => { + let mut enc = GzEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + "deflate" => { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + #[cfg(feature = "zstd")] + "zstd1" => { + let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + _ => { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + } else { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Update an organization handle from the Datadog Google Chat integration. pub async fn update_organization_handle( &self, diff --git a/src/datadogV2/api/api_llm_observability.rs b/src/datadogV2/api/api_llm_observability.rs index 6eb8b36b51..cbad0cd8a3 100644 --- a/src/datadogV2/api/api_llm_observability.rs +++ b/src/datadogV2/api/api_llm_observability.rs @@ -269,6 +269,70 @@ impl ListLLMObsExperimentsOptionalParams { } } +/// ListLLMObsPatternsClusteredPointsOptionalParams is a struct for passing parameters to the method [`LLMObservabilityAPI::list_llm_obs_patterns_clustered_points`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct ListLLMObsPatternsClusteredPointsOptionalParams { + /// Maximum number of clustered points to return per page. + pub page_size: Option, + /// Pagination token to retrieve the next page of clustered points. + pub page_token: Option, +} + +impl ListLLMObsPatternsClusteredPointsOptionalParams { + /// Maximum number of clustered points to return per page. + pub fn page_size(mut self, value: i64) -> Self { + self.page_size = Some(value); + self + } + /// Pagination token to retrieve the next page of clustered points. + pub fn page_token(mut self, value: String) -> Self { + self.page_token = Some(value); + self + } +} + +/// ListLLMObsPatternsTopicsOptionalParams is a struct for passing parameters to the method [`LLMObservabilityAPI::list_llm_obs_patterns_topics`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct ListLLMObsPatternsTopicsOptionalParams { + /// The ID of a specific patterns run. Defaults to the most recent completed run. + pub run_id: Option, +} + +impl ListLLMObsPatternsTopicsOptionalParams { + /// The ID of a specific patterns run. Defaults to the most recent completed run. + pub fn run_id(mut self, value: String) -> Self { + self.run_id = Some(value); + self + } +} + +/// ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams is a struct for passing parameters to the method [`LLMObservabilityAPI::list_llm_obs_patterns_topics_with_clustered_points`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams { + /// The ID of a specific patterns run. Defaults to the most recent completed run. + pub run_id: Option, + /// When true, enrich each clustered point with span metrics such as status, + /// duration, token counts, estimated cost, and evaluations. + pub include_metrics: Option, +} + +impl ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams { + /// The ID of a specific patterns run. Defaults to the most recent completed run. + pub fn run_id(mut self, value: String) -> Self { + self.run_id = Some(value); + self + } + /// When true, enrich each clustered point with span metrics such as status, + /// duration, token counts, estimated cost, and evaluations. + pub fn include_metrics(mut self, value: bool) -> Self { + self.include_metrics = Some(value); + self + } +} + /// ListLLMObsProjectsOptionalParams is a struct for passing parameters to the method [`LLMObservabilityAPI::list_llm_obs_projects`] #[non_exhaustive] #[derive(Clone, Default, Debug)] @@ -614,6 +678,15 @@ pub enum DeleteLLMObsExperimentsError { UnknownValue(serde_json::Value), } +/// DeleteLLMObsPatternsConfigError is a struct for typed errors of method [`LLMObservabilityAPI::delete_llm_obs_patterns_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteLLMObsPatternsConfigError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// DeleteLLMObsProjectsError is a struct for typed errors of method [`LLMObservabilityAPI::delete_llm_obs_projects`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -677,6 +750,24 @@ pub enum GetLLMObsDatasetDraftStateError { UnknownValue(serde_json::Value), } +/// GetLLMObsPatternsConfigError is a struct for typed errors of method [`LLMObservabilityAPI::get_llm_obs_patterns_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetLLMObsPatternsConfigError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// GetLLMObsPatternsRunStatusError is a struct for typed errors of method [`LLMObservabilityAPI::get_llm_obs_patterns_run_status`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetLLMObsPatternsRunStatusError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// ListLLMObsAnnotationQueuesError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_annotation_queues`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -767,6 +858,51 @@ pub enum ListLLMObsIntegrationModelsError { UnknownValue(serde_json::Value), } +/// ListLLMObsPatternsClusteredPointsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_patterns_clustered_points`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLLMObsPatternsClusteredPointsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// ListLLMObsPatternsConfigsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_patterns_configs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLLMObsPatternsConfigsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// ListLLMObsPatternsRunsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_patterns_runs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLLMObsPatternsRunsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// ListLLMObsPatternsTopicsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_patterns_topics`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLLMObsPatternsTopicsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// ListLLMObsPatternsTopicsWithClusteredPointsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_patterns_topics_with_clustered_points`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListLLMObsPatternsTopicsWithClusteredPointsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// ListLLMObsProjectsError is a struct for typed errors of method [`LLMObservabilityAPI::list_llm_obs_projects`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -830,6 +966,15 @@ pub enum SimpleSearchLLMObsExperimentationError { UnknownValue(serde_json::Value), } +/// TriggerLLMObsPatternsError is a struct for typed errors of method [`LLMObservabilityAPI::trigger_llm_obs_patterns`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum TriggerLLMObsPatternsError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// UnlockLLMObsDatasetDraftStateError is a struct for typed errors of method [`LLMObservabilityAPI::unlock_llm_obs_dataset_draft_state`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -920,6 +1065,15 @@ pub enum UpsertLLMObsAnnotationsError { UnknownValue(serde_json::Value), } +/// UpsertLLMObsPatternsConfigError is a struct for typed errors of method [`LLMObservabilityAPI::upsert_llm_obs_patterns_config`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpsertLLMObsPatternsConfigError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// Manage LLM Observability spans, data, projects, datasets, dataset records, experiments, and annotations. #[derive(Debug, Clone)] pub struct LLMObservabilityAPI { @@ -3990,6 +4144,105 @@ impl LLMObservabilityAPI { } } + /// Delete a patterns configuration by its ID. + pub async fn delete_llm_obs_patterns_config( + &self, + config_id: String, + ) -> Result<(), datadog::Error> { + match self + .delete_llm_obs_patterns_config_with_http_info(config_id) + .await + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + + /// Delete a patterns configuration by its ID. + pub async fn delete_llm_obs_patterns_config_with_http_info( + &self, + config_id: String, + ) -> Result, datadog::Error> { + let local_configuration = &self.config; + let operation_id = "v2.delete_llm_obs_patterns_config"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.delete_llm_obs_patterns_config' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/topic-discovery-configs/{config_id}", + local_configuration.get_operation_host(operation_id), + config_id = datadog::urlencode(config_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Delete one or more LLM Observability projects. pub async fn delete_llm_obs_projects( &self, @@ -4897,19 +5150,14 @@ impl LLMObservabilityAPI { } } - /// List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. - /// If neither is provided, all queues in the organization are returned. - pub async fn list_llm_obs_annotation_queues( + /// Retrieve the patterns configuration for the organization. + pub async fn get_llm_obs_patterns_config( &self, - params: ListLLMObsAnnotationQueuesOptionalParams, ) -> Result< - crate::datadogV2::model::LLMObsAnnotationQueuesResponse, - datadog::Error, + crate::datadogV2::model::LLMObsPatternsConfigResponse, + datadog::Error, > { - match self - .list_llm_obs_annotation_queues_with_http_info(params) - .await - { + match self.get_llm_obs_patterns_config_with_http_info().await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -4923,49 +5171,33 @@ impl LLMObservabilityAPI { } } - /// List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. - /// If neither is provided, all queues in the organization are returned. - pub async fn list_llm_obs_annotation_queues_with_http_info( + /// Retrieve the patterns configuration for the organization. + pub async fn get_llm_obs_patterns_config_with_http_info( &self, - params: ListLLMObsAnnotationQueuesOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_annotation_queues"; + let operation_id = "v2.get_llm_obs_patterns_config"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_annotation_queues' is not enabled".to_string(), + msg: "Operation 'v2.get_llm_obs_patterns_config' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } - // unbox and build optional parameters - let project_id = params.project_id; - let queue_ids = params.queue_ids; - let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/annotation-queues", + "{}/api/v2/llm-obs/v1/topic-discovery-configs/latest", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - if let Some(ref local_query_param) = project_id { - local_req_builder = - local_req_builder.query(&[("projectId", &local_query_param.to_string())]); - }; - if let Some(ref local) = queue_ids { - for param in local { - local_req_builder = local_req_builder.query(&[("queueIds", ¶m.to_string())]); - } - }; - // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -5008,7 +5240,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5021,7 +5253,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5032,18 +5264,17 @@ impl LLMObservabilityAPI { } } - /// List all records in an LLM Observability dataset, sorted by creation date, newest first. - pub async fn list_llm_obs_dataset_records( + /// Retrieve the status and step-by-step progress of the current or most recent + /// patterns run for a configuration. + pub async fn get_llm_obs_patterns_run_status( &self, - project_id: String, - dataset_id: String, - params: ListLLMObsDatasetRecordsOptionalParams, + config_id: String, ) -> Result< - crate::datadogV2::model::LLMObsDatasetRecordsListResponse, - datadog::Error, + crate::datadogV2::model::LLMObsPatternsRunStatusResponse, + datadog::Error, > { match self - .list_llm_obs_dataset_records_with_http_info(project_id, dataset_id, params) + .get_llm_obs_patterns_run_status_with_http_info(config_id) .await { Ok(response_content) => { @@ -5059,55 +5290,36 @@ impl LLMObservabilityAPI { } } - /// List all records in an LLM Observability dataset, sorted by creation date, newest first. - pub async fn list_llm_obs_dataset_records_with_http_info( + /// Retrieve the status and step-by-step progress of the current or most recent + /// patterns run for a configuration. + pub async fn get_llm_obs_patterns_run_status_with_http_info( &self, - project_id: String, - dataset_id: String, - params: ListLLMObsDatasetRecordsOptionalParams, + config_id: String, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_dataset_records"; + let operation_id = "v2.get_llm_obs_patterns_run_status"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_dataset_records' is not enabled".to_string(), + msg: "Operation 'v2.get_llm_obs_patterns_run_status' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } - // unbox and build optional parameters - let filter_version = params.filter_version; - let page_cursor = params.page_cursor; - let page_limit = params.page_limit; - let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records", - local_configuration.get_operation_host(operation_id), - project_id = datadog::urlencode(project_id), - dataset_id = datadog::urlencode(dataset_id) + "{}/api/v2/llm-obs/v1/topic-discovery-runs/status", + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - if let Some(ref local_query_param) = filter_version { - local_req_builder = - local_req_builder.query(&[("filter[version]", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = page_cursor { - local_req_builder = - local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = page_limit { - local_req_builder = - local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]); - }; + local_req_builder = local_req_builder.query(&[("config_id", &config_id.to_string())]); // build headers let mut headers = HeaderMap::new(); @@ -5151,7 +5363,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5164,7 +5376,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5175,17 +5387,17 @@ impl LLMObservabilityAPI { } } - /// List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. - pub async fn list_llm_obs_dataset_versions( + /// List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. + /// If neither is provided, all queues in the organization are returned. + pub async fn list_llm_obs_annotation_queues( &self, - project_id: String, - dataset_id: String, + params: ListLLMObsAnnotationQueuesOptionalParams, ) -> Result< - crate::datadogV2::model::LLMObsDatasetVersionsResponse, - datadog::Error, + crate::datadogV2::model::LLMObsAnnotationQueuesResponse, + datadog::Error, > { match self - .list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id) + .list_llm_obs_annotation_queues_with_http_info(params) .await { Ok(response_content) => { @@ -5201,37 +5413,49 @@ impl LLMObservabilityAPI { } } - /// List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. - pub async fn list_llm_obs_dataset_versions_with_http_info( + /// List annotation queues. Optionally filter by project ID or queue IDs. These parameters are mutually exclusive. + /// If neither is provided, all queues in the organization are returned. + pub async fn list_llm_obs_annotation_queues_with_http_info( &self, - project_id: String, - dataset_id: String, + params: ListLLMObsAnnotationQueuesOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_dataset_versions"; + let operation_id = "v2.list_llm_obs_annotation_queues"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_dataset_versions' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_annotation_queues' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let project_id = params.project_id; + let queue_ids = params.queue_ids; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions", - local_configuration.get_operation_host(operation_id), - project_id = datadog::urlencode(project_id), - dataset_id = datadog::urlencode(dataset_id) + "{}/api/v2/llm-obs/v1/annotation-queues", + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + if let Some(ref local_query_param) = project_id { + local_req_builder = + local_req_builder.query(&[("projectId", &local_query_param.to_string())]); + }; + if let Some(ref local) = queue_ids { + for param in local { + local_req_builder = local_req_builder.query(&[("queueIds", ¶m.to_string())]); + } + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -5274,7 +5498,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5287,7 +5511,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5298,17 +5522,18 @@ impl LLMObservabilityAPI { } } - /// List all LLM Observability datasets for a project, sorted by creation date, newest first. - pub async fn list_llm_obs_datasets( + /// List all records in an LLM Observability dataset, sorted by creation date, newest first. + pub async fn list_llm_obs_dataset_records( &self, project_id: String, - params: ListLLMObsDatasetsOptionalParams, + dataset_id: String, + params: ListLLMObsDatasetRecordsOptionalParams, ) -> Result< - crate::datadogV2::model::LLMObsDatasetsResponse, - datadog::Error, + crate::datadogV2::model::LLMObsDatasetRecordsListResponse, + datadog::Error, > { match self - .list_llm_obs_datasets_with_http_info(project_id, params) + .list_llm_obs_dataset_records_with_http_info(project_id, dataset_id, params) .await { Ok(response_content) => { @@ -5324,49 +5549,46 @@ impl LLMObservabilityAPI { } } - /// List all LLM Observability datasets for a project, sorted by creation date, newest first. - pub async fn list_llm_obs_datasets_with_http_info( + /// List all records in an LLM Observability dataset, sorted by creation date, newest first. + pub async fn list_llm_obs_dataset_records_with_http_info( &self, project_id: String, - params: ListLLMObsDatasetsOptionalParams, + dataset_id: String, + params: ListLLMObsDatasetRecordsOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_datasets"; + let operation_id = "v2.list_llm_obs_dataset_records"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_datasets' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_dataset_records' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters - let filter_name = params.filter_name; - let filter_id = params.filter_id; + let filter_version = params.filter_version; let page_cursor = params.page_cursor; let page_limit = params.page_limit; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/{project_id}/datasets", + "{}/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records", local_configuration.get_operation_host(operation_id), - project_id = datadog::urlencode(project_id) + project_id = datadog::urlencode(project_id), + dataset_id = datadog::urlencode(dataset_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - if let Some(ref local_query_param) = filter_name { - local_req_builder = - local_req_builder.query(&[("filter[name]", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = filter_id { + if let Some(ref local_query_param) = filter_version { local_req_builder = - local_req_builder.query(&[("filter[id]", &local_query_param.to_string())]); + local_req_builder.query(&[("filter[version]", &local_query_param.to_string())]); }; if let Some(ref local_query_param) = page_cursor { local_req_builder = @@ -5419,7 +5641,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5432,7 +5654,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5443,17 +5665,17 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. - pub async fn list_llm_obs_experiment_events( + /// List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + pub async fn list_llm_obs_dataset_versions( &self, - experiment_id: String, - params: ListLLMObsExperimentEventsOptionalParams, + project_id: String, + dataset_id: String, ) -> Result< - crate::datadogV2::model::LLMObsExperimentEventsV2Response, - datadog::Error, + crate::datadogV2::model::LLMObsDatasetVersionsResponse, + datadog::Error, > { match self - .list_llm_obs_experiment_events_with_http_info(experiment_id, params) + .list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id) .await { Ok(response_content) => { @@ -5469,49 +5691,37 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. - pub async fn list_llm_obs_experiment_events_with_http_info( + /// List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + pub async fn list_llm_obs_dataset_versions_with_http_info( &self, - experiment_id: String, - params: ListLLMObsExperimentEventsOptionalParams, + project_id: String, + dataset_id: String, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_experiment_events"; + let operation_id = "v2.list_llm_obs_dataset_versions"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_experiment_events' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_dataset_versions' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } - // unbox and build optional parameters - let page_limit = params.page_limit; - let page_cursor = params.page_cursor; - let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v3/experiments/{experiment_id}/events", + "{}/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions", local_configuration.get_operation_host(operation_id), - experiment_id = datadog::urlencode(experiment_id) + project_id = datadog::urlencode(project_id), + dataset_id = datadog::urlencode(dataset_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - if let Some(ref local_query_param) = page_limit { - local_req_builder = - local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = page_cursor { - local_req_builder = - local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]); - }; - // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -5554,7 +5764,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5567,7 +5777,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5578,16 +5788,17 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans with their evaluation metrics for a given experiment. Returns spans only, with no summary metrics and no pagination. Deprecated in favor of `ListLLMObsExperimentEventsV3`. - pub async fn list_llm_obs_experiment_events_v1( + /// List all LLM Observability datasets for a project, sorted by creation date, newest first. + pub async fn list_llm_obs_datasets( &self, - experiment_id: String, + project_id: String, + params: ListLLMObsDatasetsOptionalParams, ) -> Result< - crate::datadogV2::model::LLMObsExperimentSpansResponse, - datadog::Error, + crate::datadogV2::model::LLMObsDatasetsResponse, + datadog::Error, > { match self - .list_llm_obs_experiment_events_v1_with_http_info(experiment_id) + .list_llm_obs_datasets_with_http_info(project_id, params) .await { Ok(response_content) => { @@ -5603,35 +5814,59 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans with their evaluation metrics for a given experiment. Returns spans only, with no summary metrics and no pagination. Deprecated in favor of `ListLLMObsExperimentEventsV3`. - pub async fn list_llm_obs_experiment_events_v1_with_http_info( + /// List all LLM Observability datasets for a project, sorted by creation date, newest first. + pub async fn list_llm_obs_datasets_with_http_info( &self, - experiment_id: String, + project_id: String, + params: ListLLMObsDatasetsOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_experiment_events_v1"; + let operation_id = "v2.list_llm_obs_datasets"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_experiment_events_v1' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_datasets' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let filter_name = params.filter_name; + let filter_id = params.filter_id; + let page_cursor = params.page_cursor; + let page_limit = params.page_limit; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/experiments/{experiment_id}/events", + "{}/api/v2/llm-obs/v1/{project_id}/datasets", local_configuration.get_operation_host(operation_id), - experiment_id = datadog::urlencode(experiment_id) + project_id = datadog::urlencode(project_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + if let Some(ref local_query_param) = filter_name { + local_req_builder = + local_req_builder.query(&[("filter[name]", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = filter_id { + local_req_builder = + local_req_builder.query(&[("filter[id]", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = page_cursor { + local_req_builder = + local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = page_limit { + local_req_builder = + local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]); + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -5674,7 +5909,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5687,7 +5922,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5698,16 +5933,17 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans and experiment-level summary metrics for a given experiment. Returns the full events payload without pagination. Deprecated: use `ListLLMObsExperimentEventsV3` instead. - pub async fn list_llm_obs_experiment_events_v2( + /// Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. + pub async fn list_llm_obs_experiment_events( &self, experiment_id: String, + params: ListLLMObsExperimentEventsOptionalParams, ) -> Result< crate::datadogV2::model::LLMObsExperimentEventsV2Response, - datadog::Error, + datadog::Error, > { match self - .list_llm_obs_experiment_events_v2_with_http_info(experiment_id) + .list_llm_obs_experiment_events_with_http_info(experiment_id, params) .await { Ok(response_content) => { @@ -5723,35 +5959,49 @@ impl LLMObservabilityAPI { } } - /// Retrieve spans and experiment-level summary metrics for a given experiment. Returns the full events payload without pagination. Deprecated: use `ListLLMObsExperimentEventsV3` instead. - pub async fn list_llm_obs_experiment_events_v2_with_http_info( + /// Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. + pub async fn list_llm_obs_experiment_events_with_http_info( &self, experiment_id: String, + params: ListLLMObsExperimentEventsOptionalParams, ) -> Result< datadog::ResponseContent, - datadog::Error, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_experiment_events_v2"; + let operation_id = "v2.list_llm_obs_experiment_events"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_experiment_events_v2' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_experiment_events' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let page_limit = params.page_limit; + let page_cursor = params.page_cursor; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v2/experiments/{experiment_id}/events", + "{}/api/v2/llm-obs/v3/experiments/{experiment_id}/events", local_configuration.get_operation_host(operation_id), experiment_id = datadog::urlencode(experiment_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + if let Some(ref local_query_param) = page_limit { + local_req_builder = + local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = page_cursor { + local_req_builder = + local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]); + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -5807,7 +6057,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5818,9 +6068,249 @@ impl LLMObservabilityAPI { } } - /// List all LLM Observability experiments sorted by creation date, newest first. - pub async fn list_llm_obs_experiments( - &self, + /// Retrieve spans with their evaluation metrics for a given experiment. Returns spans only, with no summary metrics and no pagination. Deprecated in favor of `ListLLMObsExperimentEventsV3`. + pub async fn list_llm_obs_experiment_events_v1( + &self, + experiment_id: String, + ) -> Result< + crate::datadogV2::model::LLMObsExperimentSpansResponse, + datadog::Error, + > { + match self + .list_llm_obs_experiment_events_v1_with_http_info(experiment_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieve spans with their evaluation metrics for a given experiment. Returns spans only, with no summary metrics and no pagination. Deprecated in favor of `ListLLMObsExperimentEventsV3`. + pub async fn list_llm_obs_experiment_events_v1_with_http_info( + &self, + experiment_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_experiment_events_v1"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_experiment_events_v1' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/experiments/{experiment_id}/events", + local_configuration.get_operation_host(operation_id), + experiment_id = datadog::urlencode(experiment_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Retrieve spans and experiment-level summary metrics for a given experiment. Returns the full events payload without pagination. Deprecated: use `ListLLMObsExperimentEventsV3` instead. + pub async fn list_llm_obs_experiment_events_v2( + &self, + experiment_id: String, + ) -> Result< + crate::datadogV2::model::LLMObsExperimentEventsV2Response, + datadog::Error, + > { + match self + .list_llm_obs_experiment_events_v2_with_http_info(experiment_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieve spans and experiment-level summary metrics for a given experiment. Returns the full events payload without pagination. Deprecated: use `ListLLMObsExperimentEventsV3` instead. + pub async fn list_llm_obs_experiment_events_v2_with_http_info( + &self, + experiment_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_experiment_events_v2"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_experiment_events_v2' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v2/experiments/{experiment_id}/events", + local_configuration.get_operation_host(operation_id), + experiment_id = datadog::urlencode(experiment_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// List all LLM Observability experiments sorted by creation date, newest first. + pub async fn list_llm_obs_experiments( + &self, params: ListLLMObsExperimentsOptionalParams, ) -> Result< crate::datadogV2::model::LLMObsExperimentsResponse, @@ -5975,7 +6465,624 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Retrieve the list of configured accounts for the specified LLM provider integration. + pub async fn list_llm_obs_integration_accounts( + &self, + integration: crate::datadogV2::model::LLMObsIntegrationName, + ) -> Result< + Vec, + datadog::Error, + > { + match self + .list_llm_obs_integration_accounts_with_http_info(integration) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieve the list of configured accounts for the specified LLM provider integration. + pub async fn list_llm_obs_integration_accounts_with_http_info( + &self, + integration: crate::datadogV2::model::LLMObsIntegrationName, + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_integration_accounts"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_integration_accounts' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/integrations/{integration}/accounts", + local_configuration.get_operation_host(operation_id), + integration = datadog::urlencode(integration.to_string()) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::>( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Retrieve the list of models available for the specified LLM provider integration and account. + pub async fn list_llm_obs_integration_models( + &self, + integration: crate::datadogV2::model::LLMObsIntegrationName, + account_id: String, + ) -> Result< + Vec, + datadog::Error, + > { + match self + .list_llm_obs_integration_models_with_http_info(integration, account_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieve the list of models available for the specified LLM provider integration and account. + pub async fn list_llm_obs_integration_models_with_http_info( + &self, + integration: crate::datadogV2::model::LLMObsIntegrationName, + account_id: String, + ) -> Result< + datadog::ResponseContent>, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_integration_models"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_integration_models' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models", + local_configuration.get_operation_host(operation_id), + integration = datadog::urlencode(integration.to_string()), + account_id = datadog::urlencode(account_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::>( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// List the data points grouped into a topic. For a parent topic, points from all + /// of its leaf topics are returned. + pub async fn list_llm_obs_patterns_clustered_points( + &self, + topic_id: String, + params: ListLLMObsPatternsClusteredPointsOptionalParams, + ) -> Result< + crate::datadogV2::model::LLMObsPatternsClusteredPointsResponse, + datadog::Error, + > { + match self + .list_llm_obs_patterns_clustered_points_with_http_info(topic_id, params) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// List the data points grouped into a topic. For a parent topic, points from all + /// of its leaf topics are returned. + pub async fn list_llm_obs_patterns_clustered_points_with_http_info( + &self, + topic_id: String, + params: ListLLMObsPatternsClusteredPointsOptionalParams, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_patterns_clustered_points"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_patterns_clustered_points' is not enabled" + .to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + // unbox and build optional parameters + let page_size = params.page_size; + let page_token = params.page_token; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/topic-discovery-clustered-points", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + local_req_builder = local_req_builder.query(&[("topic_id", &topic_id.to_string())]); + if let Some(ref local_query_param) = page_size { + local_req_builder = + local_req_builder.query(&[("page_size", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = page_token { + local_req_builder = + local_req_builder.query(&[("page_token", &local_query_param.to_string())]); + }; + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::< + crate::datadogV2::model::LLMObsPatternsClusteredPointsResponse, + >(&local_content) + { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// List all patterns configurations for the organization. + pub async fn list_llm_obs_patterns_configs( + &self, + ) -> Result< + crate::datadogV2::model::LLMObsPatternsConfigsResponse, + datadog::Error, + > { + match self.list_llm_obs_patterns_configs_with_http_info().await { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// List all patterns configurations for the organization. + pub async fn list_llm_obs_patterns_configs_with_http_info( + &self, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_patterns_configs"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_patterns_configs' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/topic-discovery-configs", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// List the completed patterns runs for a configuration. + pub async fn list_llm_obs_patterns_runs( + &self, + config_id: String, + ) -> Result< + crate::datadogV2::model::LLMObsPatternsRunsResponse, + datadog::Error, + > { + match self + .list_llm_obs_patterns_runs_with_http_info(config_id) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// List the completed patterns runs for a configuration. + pub async fn list_llm_obs_patterns_runs_with_http_info( + &self, + config_id: String, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_llm_obs_patterns_runs"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.list_llm_obs_patterns_runs' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/topic-discovery-runs", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + local_req_builder = local_req_builder.query(&[("config_id", &config_id.to_string())]); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -5988,7 +7095,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -5999,16 +7106,18 @@ impl LLMObservabilityAPI { } } - /// Retrieve the list of configured accounts for the specified LLM provider integration. - pub async fn list_llm_obs_integration_accounts( + /// List the topics discovered by a patterns run. When no run is specified, + /// the most recent completed run is used. + pub async fn list_llm_obs_patterns_topics( &self, - integration: crate::datadogV2::model::LLMObsIntegrationName, + config_id: String, + params: ListLLMObsPatternsTopicsOptionalParams, ) -> Result< - Vec, - datadog::Error, + crate::datadogV2::model::LLMObsPatternsTopicsResponse, + datadog::Error, > { match self - .list_llm_obs_integration_accounts_with_http_info(integration) + .list_llm_obs_patterns_topics_with_http_info(config_id, params) .await { Ok(response_content) => { @@ -6024,35 +7133,45 @@ impl LLMObservabilityAPI { } } - /// Retrieve the list of configured accounts for the specified LLM provider integration. - pub async fn list_llm_obs_integration_accounts_with_http_info( + /// List the topics discovered by a patterns run. When no run is specified, + /// the most recent completed run is used. + pub async fn list_llm_obs_patterns_topics_with_http_info( &self, - integration: crate::datadogV2::model::LLMObsIntegrationName, + config_id: String, + params: ListLLMObsPatternsTopicsOptionalParams, ) -> Result< - datadog::ResponseContent>, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_integration_accounts"; + let operation_id = "v2.list_llm_obs_patterns_topics"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_integration_accounts' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_patterns_topics' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let run_id = params.run_id; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/integrations/{integration}/accounts", - local_configuration.get_operation_host(operation_id), - integration = datadog::urlencode(integration.to_string()) + "{}/api/v2/llm-obs/v1/topic-discovery-topics", + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + local_req_builder = local_req_builder.query(&[("config_id", &config_id.to_string())]); + if let Some(ref local_query_param) = run_id { + local_req_builder = + local_req_builder.query(&[("run_id", &local_query_param.to_string())]); + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -6095,7 +7214,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::>( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -6108,7 +7227,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -6119,17 +7238,19 @@ impl LLMObservabilityAPI { } } - /// Retrieve the list of models available for the specified LLM provider integration and account. - pub async fn list_llm_obs_integration_models( + /// List the topics discovered by a patterns run, with the clustered points attached + /// inline to each leaf topic. When no run is specified, the most recent completed + /// run is used. + pub async fn list_llm_obs_patterns_topics_with_clustered_points( &self, - integration: crate::datadogV2::model::LLMObsIntegrationName, - account_id: String, + config_id: String, + params: ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams, ) -> Result< - Vec, - datadog::Error, + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponse, + datadog::Error, > { match self - .list_llm_obs_integration_models_with_http_info(integration, account_id) + .list_llm_obs_patterns_topics_with_clustered_points_with_http_info(config_id, params) .await { Ok(response_content) => { @@ -6145,37 +7266,53 @@ impl LLMObservabilityAPI { } } - /// Retrieve the list of models available for the specified LLM provider integration and account. - pub async fn list_llm_obs_integration_models_with_http_info( + /// List the topics discovered by a patterns run, with the clustered points attached + /// inline to each leaf topic. When no run is specified, the most recent completed + /// run is used. + pub async fn list_llm_obs_patterns_topics_with_clustered_points_with_http_info( &self, - integration: crate::datadogV2::model::LLMObsIntegrationName, - account_id: String, + config_id: String, + params: ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams, ) -> Result< - datadog::ResponseContent>, - datadog::Error, + datadog::ResponseContent< + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponse, + >, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_llm_obs_integration_models"; + let operation_id = "v2.list_llm_obs_patterns_topics_with_clustered_points"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_llm_obs_integration_models' is not enabled".to_string(), + msg: "Operation 'v2.list_llm_obs_patterns_topics_with_clustered_points' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let run_id = params.run_id; + let include_metrics = params.include_metrics; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/integrations/{integration}/{account_id}/models", - local_configuration.get_operation_host(operation_id), - integration = datadog::urlencode(integration.to_string()), - account_id = datadog::urlencode(account_id) + "{}/api/v2/llm-obs/v1/topic-discovery-topics/with-cluster-points", + local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + local_req_builder = local_req_builder.query(&[("config_id", &config_id.to_string())]); + if let Some(ref local_query_param) = run_id { + local_req_builder = + local_req_builder.query(&[("run_id", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = include_metrics { + local_req_builder = + local_req_builder.query(&[("include_metrics", &local_query_param.to_string())]); + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("application/json")); @@ -6218,9 +7355,10 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::>( - &local_content, - ) { + match serde_json::from_str::< + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponse, + >(&local_content) + { Ok(e) => { return Ok(datadog::ResponseContent { status: local_status, @@ -6231,7 +7369,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -6869,18 +8007,179 @@ impl LLMObservabilityAPI { /// Returns `200 OK` when all results fit in a single page. Returns `206 Partial Content` with a cursor in `meta.after` when additional pages are available. pub async fn search_llm_obs_experimentation_with_http_info( &self, - body: crate::datadogV2::model::LLMObsExperimentationSearchRequest, + body: crate::datadogV2::model::LLMObsExperimentationSearchRequest, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.search_llm_obs_experimentation"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.search_llm_obs_experimentation' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/experimentation/search", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::POST, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Content-Type", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + // build body parameters + let output = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); + if body.serialize(&mut ser).is_ok() { + if let Some(content_encoding) = headers.get("Content-Encoding") { + match content_encoding.to_str().unwrap_or_default() { + "gzip" => { + let mut enc = GzEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + "deflate" => { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + #[cfg(feature = "zstd")] + "zstd1" => { + let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + _ => { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + } else { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Search LLM Observability spans using structured filters in the request body. + pub async fn search_llm_obs_spans( + &self, + body: crate::datadogV2::model::LLMObsSearchSpansRequest, + ) -> Result> + { + match self.search_llm_obs_spans_with_http_info(body).await { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Search LLM Observability spans using structured filters in the request body. + pub async fn search_llm_obs_spans_with_http_info( + &self, + body: crate::datadogV2::model::LLMObsSearchSpansRequest, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.search_llm_obs_experimentation"; + let operation_id = "v2.search_llm_obs_spans"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.search_llm_obs_experimentation' is not enabled".to_string(), + msg: "Operation 'v2.search_llm_obs_spans' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } @@ -6888,7 +8187,7 @@ impl LLMObservabilityAPI { let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/experimentation/search", + "{}/api/v2/llm-obs/v1/spans/events/search", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = @@ -6983,7 +8282,7 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -6996,7 +8295,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -7007,13 +8306,21 @@ impl LLMObservabilityAPI { } } - /// Search LLM Observability spans using structured filters in the request body. - pub async fn search_llm_obs_spans( + /// Search across LLM Observability experimentation entities using offset-based (page-number) pagination. + /// Use this endpoint when you need total page count or want to navigate to a specific page number. + /// + /// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. + pub async fn simple_search_llm_obs_experimentation( &self, - body: crate::datadogV2::model::LLMObsSearchSpansRequest, - ) -> Result> - { - match self.search_llm_obs_spans_with_http_info(body).await { + body: crate::datadogV2::model::LLMObsExperimentationSimpleSearchRequest, + ) -> Result< + crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, + datadog::Error, + > { + match self + .simple_search_llm_obs_experimentation_with_http_info(body) + .await + { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -7027,21 +8334,27 @@ impl LLMObservabilityAPI { } } - /// Search LLM Observability spans using structured filters in the request body. - pub async fn search_llm_obs_spans_with_http_info( + /// Search across LLM Observability experimentation entities using offset-based (page-number) pagination. + /// Use this endpoint when you need total page count or want to navigate to a specific page number. + /// + /// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. + pub async fn simple_search_llm_obs_experimentation_with_http_info( &self, - body: crate::datadogV2::model::LLMObsSearchSpansRequest, + body: crate::datadogV2::model::LLMObsExperimentationSimpleSearchRequest, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent< + crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, + >, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.search_llm_obs_spans"; + let operation_id = "v2.simple_search_llm_obs_experimentation"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.search_llm_obs_spans' is not enabled".to_string(), + msg: "Operation 'v2.simple_search_llm_obs_experimentation' is not enabled" + .to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } @@ -7049,7 +8362,7 @@ impl LLMObservabilityAPI { let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/spans/events/search", + "{}/api/v2/llm-obs/v1/experimentation/simple-search", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = @@ -7144,9 +8457,10 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { + match serde_json::from_str::< + crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, + >(&local_content) + { Ok(e) => { return Ok(datadog::ResponseContent { status: local_status, @@ -7157,7 +8471,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -7168,21 +8482,15 @@ impl LLMObservabilityAPI { } } - /// Search across LLM Observability experimentation entities using offset-based (page-number) pagination. - /// Use this endpoint when you need total page count or want to navigate to a specific page number. - /// - /// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. - pub async fn simple_search_llm_obs_experimentation( + /// Start a patterns run for a given configuration. The run executes asynchronously. + pub async fn trigger_llm_obs_patterns( &self, - body: crate::datadogV2::model::LLMObsExperimentationSimpleSearchRequest, + body: crate::datadogV2::model::LLMObsPatternsTriggerRequest, ) -> Result< - crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, - datadog::Error, + crate::datadogV2::model::LLMObsPatternsTriggerResponse, + datadog::Error, > { - match self - .simple_search_llm_obs_experimentation_with_http_info(body) - .await - { + match self.trigger_llm_obs_patterns_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -7196,27 +8504,21 @@ impl LLMObservabilityAPI { } } - /// Search across LLM Observability experimentation entities using offset-based (page-number) pagination. - /// Use this endpoint when you need total page count or want to navigate to a specific page number. - /// - /// The `filter.scope` field controls which entity types are returned. At least one valid scope must be provided. - pub async fn simple_search_llm_obs_experimentation_with_http_info( + /// Start a patterns run for a given configuration. The run executes asynchronously. + pub async fn trigger_llm_obs_patterns_with_http_info( &self, - body: crate::datadogV2::model::LLMObsExperimentationSimpleSearchRequest, + body: crate::datadogV2::model::LLMObsPatternsTriggerRequest, ) -> Result< - datadog::ResponseContent< - crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, - >, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.simple_search_llm_obs_experimentation"; + let operation_id = "v2.trigger_llm_obs_patterns"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.simple_search_llm_obs_experimentation' is not enabled" - .to_string(), + msg: "Operation 'v2.trigger_llm_obs_patterns' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } @@ -7224,7 +8526,7 @@ impl LLMObservabilityAPI { let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/llm-obs/v1/experimentation/simple-search", + "{}/api/v2/llm-obs/v1/topic-discovery-runs", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = @@ -7319,10 +8621,9 @@ impl LLMObservabilityAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::< - crate::datadogV2::model::LLMObsExperimentationSimpleSearchResponse, - >(&local_content) - { + match serde_json::from_str::( + &local_content, + ) { Ok(e) => { return Ok(datadog::ResponseContent { status: local_status, @@ -7333,7 +8634,7 @@ impl LLMObservabilityAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -8969,4 +10270,170 @@ impl LLMObservabilityAPI { Err(datadog::Error::ResponseError(local_error)) } } + + /// Create a new patterns configuration, or update an existing one when a configuration ID is provided. + pub async fn upsert_llm_obs_patterns_config( + &self, + body: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequest, + ) -> Result< + crate::datadogV2::model::LLMObsPatternsConfigResponse, + datadog::Error, + > { + match self + .upsert_llm_obs_patterns_config_with_http_info(body) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Create a new patterns configuration, or update an existing one when a configuration ID is provided. + pub async fn upsert_llm_obs_patterns_config_with_http_info( + &self, + body: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequest, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.upsert_llm_obs_patterns_config"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.upsert_llm_obs_patterns_config' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/llm-obs/v1/topic-discovery-configs", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Content-Type", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + // build body parameters + let output = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); + if body.serialize(&mut ser).is_ok() { + if let Some(content_encoding) = headers.get("Content-Encoding") { + match content_encoding.to_str().unwrap_or_default() { + "gzip" => { + let mut enc = GzEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + "deflate" => { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + #[cfg(feature = "zstd")] + "zstd1" => { + let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + _ => { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + } else { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } } diff --git a/src/datadogV2/api/api_microsoft_teams_integration.rs b/src/datadogV2/api/api_microsoft_teams_integration.rs index 8a83d8e942..92a3d48081 100644 --- a/src/datadogV2/api/api_microsoft_teams_integration.rs +++ b/src/datadogV2/api/api_microsoft_teams_integration.rs @@ -65,6 +65,14 @@ pub enum CreateWorkflowsWebhookHandleError { UnknownValue(serde_json::Value), } +/// DeleteMSTeamsUserBindingError is a struct for typed errors of method [`MicrosoftTeamsIntegrationAPI::delete_ms_teams_user_binding`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum DeleteMSTeamsUserBindingError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// DeleteTenantBasedHandleError is a struct for typed errors of method [`MicrosoftTeamsIntegrationAPI::delete_tenant_based_handle`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -529,6 +537,97 @@ impl MicrosoftTeamsIntegrationAPI { } } + /// Delete the user binding for a given tenant from the Datadog Microsoft Teams integration. + pub async fn delete_ms_teams_user_binding( + &self, + tenant_id: String, + ) -> Result<(), datadog::Error> { + match self + .delete_ms_teams_user_binding_with_http_info(tenant_id) + .await + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + + /// Delete the user binding for a given tenant from the Datadog Microsoft Teams integration. + pub async fn delete_ms_teams_user_binding_with_http_info( + &self, + tenant_id: String, + ) -> Result, datadog::Error> { + let local_configuration = &self.config; + let operation_id = "v2.delete_ms_teams_user_binding"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/ms-teams/configuration/user-binding/{tenant_id}", + local_configuration.get_operation_host(operation_id), + tenant_id = datadog::urlencode(tenant_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Delete a tenant-based handle from the Datadog Microsoft Teams integration. pub async fn delete_tenant_based_handle( &self, diff --git a/src/datadogV2/api/api_organizations.rs b/src/datadogV2/api/api_organizations.rs index c08275feea..cebe3256a7 100644 --- a/src/datadogV2/api/api_organizations.rs +++ b/src/datadogV2/api/api_organizations.rs @@ -2,15 +2,42 @@ // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2019-Present Datadog, Inc. use crate::datadog; +use async_stream::try_stream; use flate2::{ write::{GzEncoder, ZlibEncoder}, Compression, }; +use futures_core::stream::Stream; use log::warn; use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; +/// ListGlobalOrgsOptionalParams is a struct for passing parameters to the method [`OrganizationsAPI::list_global_orgs`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct ListGlobalOrgsOptionalParams { + /// Maximum number of results returned. + pub page_limit: Option, + /// String to query the next page of results. + /// This key is provided with each valid response from the API in `meta.page.next_cursor`. + pub page_cursor: Option, +} + +impl ListGlobalOrgsOptionalParams { + /// Maximum number of results returned. + pub fn page_limit(mut self, value: i32) -> Self { + self.page_limit = Some(value); + self + } + /// String to query the next page of results. + /// This key is provided with each valid response from the API in `meta.page.next_cursor`. + pub fn page_cursor(mut self, value: String) -> Self { + self.page_cursor = Some(value); + self + } +} + /// ListOrgsOptionalParams is a struct for passing parameters to the method [`OrganizationsAPI::list_orgs`] #[non_exhaustive] #[derive(Clone, Default, Debug)] @@ -59,6 +86,14 @@ pub enum GetSAMLConfigurationError { UnknownValue(serde_json::Value), } +/// ListGlobalOrgsError is a struct for typed errors of method [`OrganizationsAPI::list_global_orgs`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListGlobalOrgsError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// ListOrgConfigsError is a struct for typed errors of method [`OrganizationsAPI::list_org_configs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -83,6 +118,14 @@ pub enum ListSAMLConfigurationsError { UnknownValue(serde_json::Value), } +/// UpdateLoginOrgConfigsMaxSessionDurationError is a struct for typed errors of method [`OrganizationsAPI::update_login_org_configs_max_session_duration`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum UpdateLoginOrgConfigsMaxSessionDurationError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// UpdateOrgConfigError is a struct for typed errors of method [`OrganizationsAPI::update_org_config`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -408,6 +451,165 @@ impl OrganizationsAPI { } } + /// Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + pub async fn list_global_orgs( + &self, + user_handle: String, + params: ListGlobalOrgsOptionalParams, + ) -> Result> + { + match self + .list_global_orgs_with_http_info(user_handle, params) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + pub fn list_global_orgs_with_pagination( + &self, + user_handle: String, + mut params: ListGlobalOrgsOptionalParams, + ) -> impl Stream< + Item = Result>, + > + '_ { + try_stream! { + let mut page_size: i32 = 100; + if params.page_limit.is_none() { + params.page_limit = Some(page_size); + } else { + page_size = params.page_limit.unwrap().clone(); + } + loop { + let resp = self.list_global_orgs( user_handle.clone(),params.clone()).await?; + + let r = resp.data; + let count = r.len(); + for team in r { + yield team; + } + if count == 0 { + break; + } + let Some(meta) = resp.meta else { break }; + let Some(page) = meta.page else { break }; + let Some(next_cursor) = page.next_cursor.unwrap() else { break }; + + params.page_cursor = Some(next_cursor); + } + } + } + + /// Returns organizations across regions for the authenticated user. The `user_handle` query parameter must match the authenticated user's handle. + pub async fn list_global_orgs_with_http_info( + &self, + user_handle: String, + params: ListGlobalOrgsOptionalParams, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_global_orgs"; + + // unbox and build optional parameters + let page_limit = params.page_limit; + let page_cursor = params.page_cursor; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/global_orgs", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + local_req_builder = local_req_builder.query(&[("user_handle", &user_handle.to_string())]); + if let Some(ref local_query_param) = page_limit { + local_req_builder = + local_req_builder.query(&[("page[limit]", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = page_cursor { + local_req_builder = + local_req_builder.query(&[("page[cursor]", &local_query_param.to_string())]); + }; + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Returns all Org Configs (name, description, and value). pub async fn list_org_configs( &self, @@ -730,6 +932,148 @@ impl OrganizationsAPI { } } + /// Update the maximum session duration for the current organization. + /// The duration is specified in seconds. + pub async fn update_login_org_configs_max_session_duration( + &self, + body: crate::datadogV2::model::MaxSessionDurationUpdateRequest, + ) -> Result<(), datadog::Error> { + match self + .update_login_org_configs_max_session_duration_with_http_info(body) + .await + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + + /// Update the maximum session duration for the current organization. + /// The duration is specified in seconds. + pub async fn update_login_org_configs_max_session_duration_with_http_info( + &self, + body: crate::datadogV2::model::MaxSessionDurationUpdateRequest, + ) -> Result< + datadog::ResponseContent<()>, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.update_login_org_configs_max_session_duration"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/login/org_configs/max_session_duration", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::PUT, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Content-Type", HeaderValue::from_static("application/json")); + headers.insert("Accept", HeaderValue::from_static("*/*")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + // build body parameters + let output = Vec::new(); + let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); + if body.serialize(&mut ser).is_ok() { + if let Some(content_encoding) = headers.get("Content-Encoding") { + match content_encoding.to_str().unwrap_or_default() { + "gzip" => { + let mut enc = GzEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + "deflate" => { + let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + #[cfg(feature = "zstd")] + "zstd1" => { + let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); + let _ = enc.write_all(ser.into_inner().as_slice()); + match enc.finish() { + Ok(buf) => { + local_req_builder = local_req_builder.body(buf); + } + Err(e) => return Err(datadog::Error::Io(e)), + } + } + _ => { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + } else { + local_req_builder = local_req_builder.body(ser.into_inner()); + } + } + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: None, + }) + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Update the value of a specific Org Config. pub async fn update_org_config( &self, diff --git a/src/datadogV2/api/api_rum_retention_filters_hardcoded.rs b/src/datadogV2/api/api_rum_retention_filters_hardcoded.rs deleted file mode 100644 index bdfd43c3a1..0000000000 --- a/src/datadogV2/api/api_rum_retention_filters_hardcoded.rs +++ /dev/null @@ -1,508 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use crate::datadog; -use flate2::{ - write::{GzEncoder, ZlibEncoder}, - Compression, -}; -use reqwest::header::{HeaderMap, HeaderValue}; -use serde::{Deserialize, Serialize}; -use std::io::Write; - -/// GetHardcodedRetentionFilterError is a struct for typed errors of method [`RUMRetentionFiltersHardcodedAPI::get_hardcoded_retention_filter`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetHardcodedRetentionFilterError { - APIErrorResponse(crate::datadogV2::model::APIErrorResponse), - UnknownValue(serde_json::Value), -} - -/// ListHardcodedRetentionFiltersError is a struct for typed errors of method [`RUMRetentionFiltersHardcodedAPI::list_hardcoded_retention_filters`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum ListHardcodedRetentionFiltersError { - APIErrorResponse(crate::datadogV2::model::APIErrorResponse), - UnknownValue(serde_json::Value), -} - -/// UpdateHardcodedRetentionFilterError is a struct for typed errors of method [`RUMRetentionFiltersHardcodedAPI::update_hardcoded_retention_filter`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum UpdateHardcodedRetentionFilterError { - APIErrorResponse(crate::datadogV2::model::APIErrorResponse), - UnknownValue(serde_json::Value), -} - -/// Manage hardcoded retention filters through [Manage Applications]() in RUM. -#[derive(Debug, Clone)] -pub struct RUMRetentionFiltersHardcodedAPI { - config: datadog::Configuration, - client: reqwest_middleware::ClientWithMiddleware, -} - -impl Default for RUMRetentionFiltersHardcodedAPI { - fn default() -> Self { - Self::with_config(datadog::Configuration::default()) - } -} - -impl RUMRetentionFiltersHardcodedAPI { - pub fn new() -> Self { - Self::default() - } - pub fn with_config(config: datadog::Configuration) -> Self { - let reqwest_client_builder = { - let builder = reqwest::Client::builder(); - #[cfg(not(target_arch = "wasm32"))] - let builder = if let Some(proxy_url) = &config.proxy_url { - builder.proxy(reqwest::Proxy::all(proxy_url).expect("Failed to parse proxy URL")) - } else { - builder - }; - builder - }; - - let middleware_client_builder = { - let builder = - reqwest_middleware::ClientBuilder::new(reqwest_client_builder.build().unwrap()); - #[cfg(feature = "retry")] - let builder = if config.enable_retry { - struct RetryableStatus; - impl reqwest_retry::RetryableStrategy for RetryableStatus { - fn handle( - &self, - res: &Result, - ) -> Option { - match res { - Ok(success) => reqwest_retry::default_on_request_success(success), - Err(_) => None, - } - } - } - let backoff_policy = reqwest_retry::policies::ExponentialBackoff::builder() - .build_with_max_retries(config.max_retries); - - let retry_middleware = - reqwest_retry::RetryTransientMiddleware::new_with_policy_and_strategy( - backoff_policy, - RetryableStatus, - ); - - builder.with(retry_middleware) - } else { - builder - }; - builder - }; - - let client = middleware_client_builder.build(); - - Self { config, client } - } - - pub fn with_client_and_config( - config: datadog::Configuration, - client: reqwest_middleware::ClientWithMiddleware, - ) -> Self { - Self { config, client } - } - - /// Get a single hardcoded retention filter for a RUM application. - pub async fn get_hardcoded_retention_filter( - &self, - app_id: String, - rf_id: String, - ) -> Result< - crate::datadogV2::model::RumHardcodedRetentionFilterResponse, - datadog::Error, - > { - match self - .get_hardcoded_retention_filter_with_http_info(app_id, rf_id) - .await - { - Ok(response_content) => { - if let Some(e) = response_content.entity { - Ok(e) - } else { - Err(datadog::Error::Serde(serde::de::Error::custom( - "response content was None", - ))) - } - } - Err(err) => Err(err), - } - } - - /// Get a single hardcoded retention filter for a RUM application. - pub async fn get_hardcoded_retention_filter_with_http_info( - &self, - app_id: String, - rf_id: String, - ) -> Result< - datadog::ResponseContent, - datadog::Error, - > { - let local_configuration = &self.config; - let operation_id = "v2.get_hardcoded_retention_filter"; - - let local_client = &self.client; - - let local_uri_str = format!( - "{}/api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}", - local_configuration.get_operation_host(operation_id), - app_id = datadog::urlencode(app_id), - rf_id = datadog::urlencode(rf_id) - ); - let mut local_req_builder = - local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - - // build headers - let mut headers = HeaderMap::new(); - headers.insert("Accept", HeaderValue::from_static("application/json")); - - // build user agent - match HeaderValue::from_str(local_configuration.user_agent.as_str()) { - Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), - Err(e) => { - log::warn!("Failed to parse user agent header: {e}, falling back to default"); - headers.insert( - reqwest::header::USER_AGENT, - HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), - ) - } - }; - - // build auth - if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { - headers.insert( - "DD-API-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-API-KEY header"), - ); - }; - if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { - headers.insert( - "DD-APPLICATION-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-APPLICATION-KEY header"), - ); - }; - - local_req_builder = local_req_builder.headers(headers); - let local_req = local_req_builder.build()?; - log::debug!("request content: {:?}", local_req.body()); - let local_resp = local_client.execute(local_req).await?; - - let local_status = local_resp.status(); - let local_content = local_resp.text().await?; - log::debug!("response content: {}", local_content); - - if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { - Ok(e) => { - return Ok(datadog::ResponseContent { - status: local_status, - content: local_content, - entity: Some(e), - }) - } - Err(e) => return Err(datadog::Error::Serde(e)), - }; - } else { - let local_entity: Option = - serde_json::from_str(&local_content).ok(); - let local_error = datadog::ResponseContent { - status: local_status, - content: local_content, - entity: local_entity, - }; - Err(datadog::Error::ResponseError(local_error)) - } - } - - /// Get the list of hardcoded retention filters for a RUM application. - pub async fn list_hardcoded_retention_filters( - &self, - app_id: String, - ) -> Result< - crate::datadogV2::model::RumHardcodedRetentionFiltersResponse, - datadog::Error, - > { - match self - .list_hardcoded_retention_filters_with_http_info(app_id) - .await - { - Ok(response_content) => { - if let Some(e) = response_content.entity { - Ok(e) - } else { - Err(datadog::Error::Serde(serde::de::Error::custom( - "response content was None", - ))) - } - } - Err(err) => Err(err), - } - } - - /// Get the list of hardcoded retention filters for a RUM application. - pub async fn list_hardcoded_retention_filters_with_http_info( - &self, - app_id: String, - ) -> Result< - datadog::ResponseContent, - datadog::Error, - > { - let local_configuration = &self.config; - let operation_id = "v2.list_hardcoded_retention_filters"; - - let local_client = &self.client; - - let local_uri_str = format!( - "{}/api/v2/rum/applications/{app_id}/hardcoded_retention_filters", - local_configuration.get_operation_host(operation_id), - app_id = datadog::urlencode(app_id) - ); - let mut local_req_builder = - local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - - // build headers - let mut headers = HeaderMap::new(); - headers.insert("Accept", HeaderValue::from_static("application/json")); - - // build user agent - match HeaderValue::from_str(local_configuration.user_agent.as_str()) { - Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), - Err(e) => { - log::warn!("Failed to parse user agent header: {e}, falling back to default"); - headers.insert( - reqwest::header::USER_AGENT, - HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), - ) - } - }; - - // build auth - if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { - headers.insert( - "DD-API-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-API-KEY header"), - ); - }; - if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { - headers.insert( - "DD-APPLICATION-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-APPLICATION-KEY header"), - ); - }; - - local_req_builder = local_req_builder.headers(headers); - let local_req = local_req_builder.build()?; - log::debug!("request content: {:?}", local_req.body()); - let local_resp = local_client.execute(local_req).await?; - - let local_status = local_resp.status(); - let local_content = local_resp.text().await?; - log::debug!("response content: {}", local_content); - - if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::< - crate::datadogV2::model::RumHardcodedRetentionFiltersResponse, - >(&local_content) - { - Ok(e) => { - return Ok(datadog::ResponseContent { - status: local_status, - content: local_content, - entity: Some(e), - }) - } - Err(e) => return Err(datadog::Error::Serde(e)), - }; - } else { - let local_entity: Option = - serde_json::from_str(&local_content).ok(); - let local_error = datadog::ResponseContent { - status: local_status, - content: local_content, - entity: local_entity, - }; - Err(datadog::Error::ResponseError(local_error)) - } - } - - /// Update the cross-product sample rates of a hardcoded retention filter for a RUM application. - /// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - /// Any other field is read-only and cannot be sent in the payload. - /// Returns the updated hardcoded retention filter when the request is successful. - pub async fn update_hardcoded_retention_filter( - &self, - app_id: String, - rf_id: String, - body: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateRequest, - ) -> Result< - crate::datadogV2::model::RumHardcodedRetentionFilterResponse, - datadog::Error, - > { - match self - .update_hardcoded_retention_filter_with_http_info(app_id, rf_id, body) - .await - { - Ok(response_content) => { - if let Some(e) = response_content.entity { - Ok(e) - } else { - Err(datadog::Error::Serde(serde::de::Error::custom( - "response content was None", - ))) - } - } - Err(err) => Err(err), - } - } - - /// Update the cross-product sample rates of a hardcoded retention filter for a RUM application. - /// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - /// Any other field is read-only and cannot be sent in the payload. - /// Returns the updated hardcoded retention filter when the request is successful. - pub async fn update_hardcoded_retention_filter_with_http_info( - &self, - app_id: String, - rf_id: String, - body: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateRequest, - ) -> Result< - datadog::ResponseContent, - datadog::Error, - > { - let local_configuration = &self.config; - let operation_id = "v2.update_hardcoded_retention_filter"; - - let local_client = &self.client; - - let local_uri_str = format!( - "{}/api/v2/rum/applications/{app_id}/hardcoded_retention_filters/{rf_id}", - local_configuration.get_operation_host(operation_id), - app_id = datadog::urlencode(app_id), - rf_id = datadog::urlencode(rf_id) - ); - let mut local_req_builder = - local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); - - // build headers - let mut headers = HeaderMap::new(); - headers.insert("Content-Type", HeaderValue::from_static("application/json")); - headers.insert("Accept", HeaderValue::from_static("application/json")); - - // build user agent - match HeaderValue::from_str(local_configuration.user_agent.as_str()) { - Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), - Err(e) => { - log::warn!("Failed to parse user agent header: {e}, falling back to default"); - headers.insert( - reqwest::header::USER_AGENT, - HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), - ) - } - }; - - // build auth - if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { - headers.insert( - "DD-API-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-API-KEY header"), - ); - }; - if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { - headers.insert( - "DD-APPLICATION-KEY", - HeaderValue::from_str(local_key.key.as_str()) - .expect("failed to parse DD-APPLICATION-KEY header"), - ); - }; - - // build body parameters - let output = Vec::new(); - let mut ser = serde_json::Serializer::with_formatter(output, datadog::DDFormatter); - if body.serialize(&mut ser).is_ok() { - if let Some(content_encoding) = headers.get("Content-Encoding") { - match content_encoding.to_str().unwrap_or_default() { - "gzip" => { - let mut enc = GzEncoder::new(Vec::new(), Compression::default()); - let _ = enc.write_all(ser.into_inner().as_slice()); - match enc.finish() { - Ok(buf) => { - local_req_builder = local_req_builder.body(buf); - } - Err(e) => return Err(datadog::Error::Io(e)), - } - } - "deflate" => { - let mut enc = ZlibEncoder::new(Vec::new(), Compression::default()); - let _ = enc.write_all(ser.into_inner().as_slice()); - match enc.finish() { - Ok(buf) => { - local_req_builder = local_req_builder.body(buf); - } - Err(e) => return Err(datadog::Error::Io(e)), - } - } - #[cfg(feature = "zstd")] - "zstd1" => { - let mut enc = zstd::stream::Encoder::new(Vec::new(), 0).unwrap(); - let _ = enc.write_all(ser.into_inner().as_slice()); - match enc.finish() { - Ok(buf) => { - local_req_builder = local_req_builder.body(buf); - } - Err(e) => return Err(datadog::Error::Io(e)), - } - } - _ => { - local_req_builder = local_req_builder.body(ser.into_inner()); - } - } - } else { - local_req_builder = local_req_builder.body(ser.into_inner()); - } - } - - local_req_builder = local_req_builder.headers(headers); - let local_req = local_req_builder.build()?; - log::debug!("request content: {:?}", local_req.body()); - let local_resp = local_client.execute(local_req).await?; - - let local_status = local_resp.status(); - let local_content = local_resp.text().await?; - log::debug!("response content: {}", local_content); - - if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { - Ok(e) => { - return Ok(datadog::ResponseContent { - status: local_status, - content: local_content, - entity: Some(e), - }) - } - Err(e) => return Err(datadog::Error::Serde(e)), - }; - } else { - let local_entity: Option = - serde_json::from_str(&local_content).ok(); - let local_error = datadog::ResponseContent { - status: local_status, - content: local_content, - entity: local_entity, - }; - Err(datadog::Error::ResponseError(local_error)) - } - } -} diff --git a/src/datadogV2/api/api_security_monitoring.rs b/src/datadogV2/api/api_security_monitoring.rs index 4aed79d923..4b73e2c1a9 100644 --- a/src/datadogV2/api/api_security_monitoring.rs +++ b/src/datadogV2/api/api_security_monitoring.rs @@ -2379,6 +2379,14 @@ pub enum PatchVulnerabilityNotificationRuleError { UnknownValue(serde_json::Value), } +/// RestoreSecurityMonitoringRuleError is a struct for typed errors of method [`SecurityMonitoringAPI::restore_security_monitoring_rule`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum RestoreSecurityMonitoringRuleError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// RunHistoricalJobError is a struct for typed errors of method [`SecurityMonitoringAPI::run_historical_job`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -18785,6 +18793,133 @@ impl SecurityMonitoringAPI { } } + /// Restores a custom detection rule to a previously saved historical version. + /// Only custom rules can be restored. Default and partner rules return 400. + /// The restore creates a new version entry; it does not overwrite history. + pub async fn restore_security_monitoring_rule( + &self, + rule_id: String, + version: i64, + ) -> Result< + crate::datadogV2::model::SecurityMonitoringRuleResponse, + datadog::Error, + > { + match self + .restore_security_monitoring_rule_with_http_info(rule_id, version) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Restores a custom detection rule to a previously saved historical version. + /// Only custom rules can be restored. Default and partner rules return 400. + /// The restore creates a new version entry; it does not overwrite history. + pub async fn restore_security_monitoring_rule_with_http_info( + &self, + rule_id: String, + version: i64, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.restore_security_monitoring_rule"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.restore_security_monitoring_rule' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/security_monitoring/rules/{rule_id}/restore/{version}", + local_configuration.get_operation_host(operation_id), + rule_id = datadog::urlencode(rule_id), + version = version + ); + let mut local_req_builder = + local_client.request(reqwest::Method::POST, local_uri_str.as_str()); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + /// Run a historical job. pub async fn run_historical_job( &self, diff --git a/src/datadogV2/api/api_slack_integration.rs b/src/datadogV2/api/api_slack_integration.rs new file mode 100644 index 0000000000..274be81940 --- /dev/null +++ b/src/datadogV2/api/api_slack_integration.rs @@ -0,0 +1,203 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use crate::datadog; +use reqwest::header::{HeaderMap, HeaderValue}; +use serde::{Deserialize, Serialize}; + +/// ListSlackUserBindingsError is a struct for typed errors of method [`SlackIntegrationAPI::list_slack_user_bindings`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum ListSlackUserBindingsError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// Configure your [Datadog Slack integration]() +/// directly through the Datadog API. +#[derive(Debug, Clone)] +pub struct SlackIntegrationAPI { + config: datadog::Configuration, + client: reqwest_middleware::ClientWithMiddleware, +} + +impl Default for SlackIntegrationAPI { + fn default() -> Self { + Self::with_config(datadog::Configuration::default()) + } +} + +impl SlackIntegrationAPI { + pub fn new() -> Self { + Self::default() + } + pub fn with_config(config: datadog::Configuration) -> Self { + let reqwest_client_builder = { + let builder = reqwest::Client::builder(); + #[cfg(not(target_arch = "wasm32"))] + let builder = if let Some(proxy_url) = &config.proxy_url { + builder.proxy(reqwest::Proxy::all(proxy_url).expect("Failed to parse proxy URL")) + } else { + builder + }; + builder + }; + + let middleware_client_builder = { + let builder = + reqwest_middleware::ClientBuilder::new(reqwest_client_builder.build().unwrap()); + #[cfg(feature = "retry")] + let builder = if config.enable_retry { + struct RetryableStatus; + impl reqwest_retry::RetryableStrategy for RetryableStatus { + fn handle( + &self, + res: &Result, + ) -> Option { + match res { + Ok(success) => reqwest_retry::default_on_request_success(success), + Err(_) => None, + } + } + } + let backoff_policy = reqwest_retry::policies::ExponentialBackoff::builder() + .build_with_max_retries(config.max_retries); + + let retry_middleware = + reqwest_retry::RetryTransientMiddleware::new_with_policy_and_strategy( + backoff_policy, + RetryableStatus, + ); + + builder.with(retry_middleware) + } else { + builder + }; + builder + }; + + let client = middleware_client_builder.build(); + + Self { config, client } + } + + pub fn with_client_and_config( + config: datadog::Configuration, + client: reqwest_middleware::ClientWithMiddleware, + ) -> Self { + Self { config, client } + } + + /// List all Slack user bindings for a given Datadog user from the Datadog Slack integration. + pub async fn list_slack_user_bindings( + &self, + user_uuid: uuid::Uuid, + ) -> Result< + crate::datadogV2::model::SlackUserBindingsResponse, + datadog::Error, + > { + match self + .list_slack_user_bindings_with_http_info(user_uuid) + .await + { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// List all Slack user bindings for a given Datadog user from the Datadog Slack integration. + pub async fn list_slack_user_bindings_with_http_info( + &self, + user_uuid: uuid::Uuid, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.list_slack_user_bindings"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/integration/slack/user-bindings", + local_configuration.get_operation_host(operation_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + local_req_builder = local_req_builder.query(&[("user_uuid", &user_uuid.to_string())]); + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::( + &local_content, + ) { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = + serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } +} diff --git a/src/datadogV2/api/api_incident_services.rs b/src/datadogV2/api/api_tag_policies.rs similarity index 55% rename from src/datadogV2/api/api_incident_services.rs rename to src/datadogV2/api/api_tag_policies.rs index 7dd96d1009..413745f916 100644 --- a/src/datadogV2/api/api_incident_services.rs +++ b/src/datadogV2/api/api_tag_policies.rs @@ -11,113 +11,198 @@ use reqwest::header::{HeaderMap, HeaderValue}; use serde::{Deserialize, Serialize}; use std::io::Write; -/// GetIncidentServiceOptionalParams is a struct for passing parameters to the method [`IncidentServicesAPI::get_incident_service`] +/// DeleteTagPolicyOptionalParams is a struct for passing parameters to the method [`TagPoliciesAPI::delete_tag_policy`] #[non_exhaustive] #[derive(Clone, Default, Debug)] -pub struct GetIncidentServiceOptionalParams { - /// Specifies which types of related objects should be included in the response. - pub include: Option, +pub struct DeleteTagPolicyOptionalParams { + /// Whether to permanently delete the policy instead of performing a soft delete. Defaults to `false`. + pub hard_delete: Option, } -impl GetIncidentServiceOptionalParams { - /// Specifies which types of related objects should be included in the response. - pub fn include(mut self, value: crate::datadogV2::model::IncidentRelatedObject) -> Self { +impl DeleteTagPolicyOptionalParams { + /// Whether to permanently delete the policy instead of performing a soft delete. Defaults to `false`. + pub fn hard_delete(mut self, value: bool) -> Self { + self.hard_delete = Some(value); + self + } +} + +/// GetTagPolicyOptionalParams is a struct for passing parameters to the method [`TagPoliciesAPI::get_tag_policy`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct GetTagPolicyOptionalParams { + /// Comma-separated list of related resources to include alongside the policy. Currently the only supported value is `score`. + pub include: Option, + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + pub ts_start: Option, + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub ts_end: Option, +} + +impl GetTagPolicyOptionalParams { + /// Comma-separated list of related resources to include alongside the policy. Currently the only supported value is `score`. + pub fn include(mut self, value: crate::datadogV2::model::TagPolicyInclude) -> Self { self.include = Some(value); self } + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + pub fn ts_start(mut self, value: i64) -> Self { + self.ts_start = Some(value); + self + } + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub fn ts_end(mut self, value: i64) -> Self { + self.ts_end = Some(value); + self + } } -/// ListIncidentServicesOptionalParams is a struct for passing parameters to the method [`IncidentServicesAPI::list_incident_services`] +/// GetTagPolicyScoreOptionalParams is a struct for passing parameters to the method [`TagPoliciesAPI::get_tag_policy_score`] #[non_exhaustive] #[derive(Clone, Default, Debug)] -pub struct ListIncidentServicesOptionalParams { - /// Specifies which types of related objects should be included in the response. - pub include: Option, - /// Size for a given page. The maximum allowed value is 100. - pub page_size: Option, - /// Specific offset to use as the beginning of the returned page. - pub page_offset: Option, - /// A search query that filters services by name. - pub filter: Option, +pub struct GetTagPolicyScoreOptionalParams { + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + pub ts_start: Option, + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub ts_end: Option, +} + +impl GetTagPolicyScoreOptionalParams { + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. + pub fn ts_start(mut self, value: i64) -> Self { + self.ts_start = Some(value); + self + } + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub fn ts_end(mut self, value: i64) -> Self { + self.ts_end = Some(value); + self + } } -impl ListIncidentServicesOptionalParams { - /// Specifies which types of related objects should be included in the response. - pub fn include(mut self, value: crate::datadogV2::model::IncidentRelatedObject) -> Self { +/// ListTagPoliciesOptionalParams is a struct for passing parameters to the method [`TagPoliciesAPI::list_tag_policies`] +#[non_exhaustive] +#[derive(Clone, Default, Debug)] +pub struct ListTagPoliciesOptionalParams { + /// Whether to include policies that are currently disabled. Defaults to `false`. + pub include_disabled: Option, + /// Whether to include policies that have been soft-deleted. Defaults to `false`. + pub include_deleted: Option, + /// Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is `score`. + pub include: Option, + /// Restrict the result set to policies whose source matches the given value. + pub filter_source: Option, + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source. + pub ts_start: Option, + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub ts_end: Option, +} + +impl ListTagPoliciesOptionalParams { + /// Whether to include policies that are currently disabled. Defaults to `false`. + pub fn include_disabled(mut self, value: bool) -> Self { + self.include_disabled = Some(value); + self + } + /// Whether to include policies that have been soft-deleted. Defaults to `false`. + pub fn include_deleted(mut self, value: bool) -> Self { + self.include_deleted = Some(value); + self + } + /// Comma-separated list of related resources to include alongside each policy in the response. Currently the only supported value is `score`. + pub fn include(mut self, value: crate::datadogV2::model::TagPolicyInclude) -> Self { self.include = Some(value); self } - /// Size for a given page. The maximum allowed value is 100. - pub fn page_size(mut self, value: i64) -> Self { - self.page_size = Some(value); + /// Restrict the result set to policies whose source matches the given value. + pub fn filter_source(mut self, value: crate::datadogV2::model::TagPolicySource) -> Self { + self.filter_source = Some(value); self } - /// Specific offset to use as the beginning of the returned page. - pub fn page_offset(mut self, value: i64) -> Self { - self.page_offset = Some(value); + /// Start of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Defaults to a recent window appropriate for the source. + pub fn ts_start(mut self, value: i64) -> Self { + self.ts_start = Some(value); self } - /// A search query that filters services by name. - pub fn filter(mut self, value: String) -> Self { - self.filter = Some(value); + /// End of the time window used for compliance score computation, as a Unix timestamp in milliseconds. Must be in the past and greater than `ts_start`. + pub fn ts_end(mut self, value: i64) -> Self { + self.ts_end = Some(value); self } } -/// CreateIncidentServiceError is a struct for typed errors of method [`IncidentServicesAPI::create_incident_service`] +/// CreateTagPolicyError is a struct for typed errors of method [`TagPoliciesAPI::create_tag_policy`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum CreateTagPolicyError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + +/// DeleteTagPolicyError is a struct for typed errors of method [`TagPoliciesAPI::delete_tag_policy`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum CreateIncidentServiceError { +pub enum DeleteTagPolicyError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), APIErrorResponse(crate::datadogV2::model::APIErrorResponse), UnknownValue(serde_json::Value), } -/// DeleteIncidentServiceError is a struct for typed errors of method [`IncidentServicesAPI::delete_incident_service`] +/// GetTagPolicyError is a struct for typed errors of method [`TagPoliciesAPI::get_tag_policy`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum DeleteIncidentServiceError { +pub enum GetTagPolicyError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), APIErrorResponse(crate::datadogV2::model::APIErrorResponse), UnknownValue(serde_json::Value), } -/// GetIncidentServiceError is a struct for typed errors of method [`IncidentServicesAPI::get_incident_service`] +/// GetTagPolicyScoreError is a struct for typed errors of method [`TagPoliciesAPI::get_tag_policy_score`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum GetIncidentServiceError { +pub enum GetTagPolicyScoreError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), APIErrorResponse(crate::datadogV2::model::APIErrorResponse), UnknownValue(serde_json::Value), } -/// ListIncidentServicesError is a struct for typed errors of method [`IncidentServicesAPI::list_incident_services`] +/// ListTagPoliciesError is a struct for typed errors of method [`TagPoliciesAPI::list_tag_policies`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum ListIncidentServicesError { +pub enum ListTagPoliciesError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), APIErrorResponse(crate::datadogV2::model::APIErrorResponse), UnknownValue(serde_json::Value), } -/// UpdateIncidentServiceError is a struct for typed errors of method [`IncidentServicesAPI::update_incident_service`] +/// UpdateTagPolicyError is a struct for typed errors of method [`TagPoliciesAPI::update_tag_policy`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] -pub enum UpdateIncidentServiceError { +pub enum UpdateTagPolicyError { + JSONAPIErrorResponse(crate::datadogV2::model::JSONAPIErrorResponse), APIErrorResponse(crate::datadogV2::model::APIErrorResponse), UnknownValue(serde_json::Value), } -/// Create, update, delete, and retrieve services which can be associated with incidents. See the [Incident Management page]() for more information. +/// Tag Policies define rules that govern which tag values are accepted for a given tag key, +/// scoped to a particular telemetry source (such as logs, spans, or metrics). Policies can be +/// `blocking` (data not matching the policy is rejected) or `surfacing` (matching data is +/// highlighted but not blocked). Each policy reports a compliance `score` derived from how +/// much recent telemetry adheres to the policy. #[derive(Debug, Clone)] -pub struct IncidentServicesAPI { +pub struct TagPoliciesAPI { config: datadog::Configuration, client: reqwest_middleware::ClientWithMiddleware, } -impl Default for IncidentServicesAPI { +impl Default for TagPoliciesAPI { fn default() -> Self { Self::with_config(datadog::Configuration::default()) } } -impl IncidentServicesAPI { +impl TagPoliciesAPI { pub fn new() -> Self { Self::default() } @@ -178,15 +263,15 @@ impl IncidentServicesAPI { Self { config, client } } - /// Creates a new incident service. - pub async fn create_incident_service( + /// Create a new tag policy for the organization. The caller's organization is derived from + /// the authenticated user; cross-organization creation is not supported. Fields such as + /// `policy_id`, `version`, and the timestamp/audit fields are assigned by the server. + pub async fn create_tag_policy( &self, - body: crate::datadogV2::model::IncidentServiceCreateRequest, - ) -> Result< - crate::datadogV2::model::IncidentServiceResponse, - datadog::Error, - > { - match self.create_incident_service_with_http_info(body).await { + body: crate::datadogV2::model::TagPolicyCreateRequest, + ) -> Result> + { + match self.create_tag_policy_with_http_info(body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -200,21 +285,23 @@ impl IncidentServicesAPI { } } - /// Creates a new incident service. - pub async fn create_incident_service_with_http_info( + /// Create a new tag policy for the organization. The caller's organization is derived from + /// the authenticated user; cross-organization creation is not supported. Fields such as + /// `policy_id`, `version`, and the timestamp/audit fields are assigned by the server. + pub async fn create_tag_policy_with_http_info( &self, - body: crate::datadogV2::model::IncidentServiceCreateRequest, + body: crate::datadogV2::model::TagPolicyCreateRequest, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.create_incident_service"; + let operation_id = "v2.create_tag_policy"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.create_incident_service' is not enabled".to_string(), + msg: "Operation 'v2.create_tag_policy' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } @@ -222,7 +309,7 @@ impl IncidentServicesAPI { let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/services", + "{}/api/v2/tag-policies", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = @@ -317,9 +404,8 @@ impl IncidentServicesAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { + match serde_json::from_str::(&local_content) + { Ok(e) => { return Ok(datadog::ResponseContent { status: local_status, @@ -330,7 +416,7 @@ impl IncidentServicesAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -341,13 +427,16 @@ impl IncidentServicesAPI { } } - /// Deletes an existing incident service. - pub async fn delete_incident_service( + /// Delete a tag policy. By default the policy is soft-deleted so it can be recovered later + /// and so that historical score data remains queryable. Pass `hard_delete=true` to remove + /// the policy permanently. + pub async fn delete_tag_policy( &self, - service_id: String, - ) -> Result<(), datadog::Error> { + policy_id: String, + params: DeleteTagPolicyOptionalParams, + ) -> Result<(), datadog::Error> { match self - .delete_incident_service_with_http_info(service_id) + .delete_tag_policy_with_http_info(policy_id, params) .await { Ok(_) => Ok(()), @@ -355,32 +444,43 @@ impl IncidentServicesAPI { } } - /// Deletes an existing incident service. - pub async fn delete_incident_service_with_http_info( + /// Delete a tag policy. By default the policy is soft-deleted so it can be recovered later + /// and so that historical score data remains queryable. Pass `hard_delete=true` to remove + /// the policy permanently. + pub async fn delete_tag_policy_with_http_info( &self, - service_id: String, - ) -> Result, datadog::Error> { + policy_id: String, + params: DeleteTagPolicyOptionalParams, + ) -> Result, datadog::Error> { let local_configuration = &self.config; - let operation_id = "v2.delete_incident_service"; + let operation_id = "v2.delete_tag_policy"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.delete_incident_service' is not enabled".to_string(), + msg: "Operation 'v2.delete_tag_policy' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } + // unbox and build optional parameters + let hard_delete = params.hard_delete; + let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/services/{service_id}", + "{}/api/v2/tag-policies/{policy_id}", local_configuration.get_operation_host(operation_id), - service_id = datadog::urlencode(service_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::DELETE, local_uri_str.as_str()); + if let Some(ref local_query_param) = hard_delete { + local_req_builder = + local_req_builder.query(&[("hard_delete", &local_query_param.to_string())]); + }; + // build headers let mut headers = HeaderMap::new(); headers.insert("Accept", HeaderValue::from_static("*/*")); @@ -429,7 +529,7 @@ impl IncidentServicesAPI { entity: None, }) } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -440,18 +540,156 @@ impl IncidentServicesAPI { } } - /// Get details of an incident service. If the `include[users]` query parameter is provided, - /// the included attribute will contain the users related to these incident services. - pub async fn get_incident_service( + /// Retrieve a single tag policy by ID. Optionally include the policy's current compliance + /// score via the `include=score` query parameter. Policies belonging to other organizations + /// cannot be retrieved. + pub async fn get_tag_policy( + &self, + policy_id: String, + params: GetTagPolicyOptionalParams, + ) -> Result> { + match self.get_tag_policy_with_http_info(policy_id, params).await { + Ok(response_content) => { + if let Some(e) = response_content.entity { + Ok(e) + } else { + Err(datadog::Error::Serde(serde::de::Error::custom( + "response content was None", + ))) + } + } + Err(err) => Err(err), + } + } + + /// Retrieve a single tag policy by ID. Optionally include the policy's current compliance + /// score via the `include=score` query parameter. Policies belonging to other organizations + /// cannot be retrieved. + pub async fn get_tag_policy_with_http_info( + &self, + policy_id: String, + params: GetTagPolicyOptionalParams, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_tag_policy"; + if local_configuration.is_unstable_operation_enabled(operation_id) { + warn!("Using unstable operation {operation_id}"); + } else { + let local_error = datadog::UnstableOperationDisabledError { + msg: "Operation 'v2.get_tag_policy' is not enabled".to_string(), + }; + return Err(datadog::Error::UnstableOperationDisabledError(local_error)); + } + + // unbox and build optional parameters + let include = params.include; + let ts_start = params.ts_start; + let ts_end = params.ts_end; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/tag-policies/{policy_id}", + local_configuration.get_operation_host(operation_id), + policy_id = datadog::urlencode(policy_id) + ); + let mut local_req_builder = + local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + + if let Some(ref local_query_param) = include { + local_req_builder = + local_req_builder.query(&[("include", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = ts_start { + local_req_builder = + local_req_builder.query(&[("ts_start", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = ts_end { + local_req_builder = + local_req_builder.query(&[("ts_end", &local_query_param.to_string())]); + }; + + // build headers + let mut headers = HeaderMap::new(); + headers.insert("Accept", HeaderValue::from_static("application/json")); + + // build user agent + match HeaderValue::from_str(local_configuration.user_agent.as_str()) { + Ok(user_agent) => headers.insert(reqwest::header::USER_AGENT, user_agent), + Err(e) => { + log::warn!("Failed to parse user agent header: {e}, falling back to default"); + headers.insert( + reqwest::header::USER_AGENT, + HeaderValue::from_static(datadog::DEFAULT_USER_AGENT.as_str()), + ) + } + }; + + // build auth + if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { + headers.insert( + "DD-API-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-API-KEY header"), + ); + }; + if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { + headers.insert( + "DD-APPLICATION-KEY", + HeaderValue::from_str(local_key.key.as_str()) + .expect("failed to parse DD-APPLICATION-KEY header"), + ); + }; + + local_req_builder = local_req_builder.headers(headers); + let local_req = local_req_builder.build()?; + log::debug!("request content: {:?}", local_req.body()); + let local_resp = local_client.execute(local_req).await?; + + let local_status = local_resp.status(); + let local_content = local_resp.text().await?; + log::debug!("response content: {}", local_content); + + if !local_status.is_client_error() && !local_status.is_server_error() { + match serde_json::from_str::(&local_content) + { + Ok(e) => { + return Ok(datadog::ResponseContent { + status: local_status, + content: local_content, + entity: Some(e), + }) + } + Err(e) => return Err(datadog::Error::Serde(e)), + }; + } else { + let local_entity: Option = serde_json::from_str(&local_content).ok(); + let local_error = datadog::ResponseContent { + status: local_status, + content: local_content, + entity: local_entity, + }; + Err(datadog::Error::ResponseError(local_error)) + } + } + + /// Retrieve the compliance score for a single tag policy. The score is computed over the + /// requested time window (or a source-appropriate default) and represents the percentage of + /// telemetry within that window that conforms to the policy. A `null` score indicates that + /// no relevant telemetry was found. + pub async fn get_tag_policy_score( &self, - service_id: String, - params: GetIncidentServiceOptionalParams, + policy_id: String, + params: GetTagPolicyScoreOptionalParams, ) -> Result< - crate::datadogV2::model::IncidentServiceResponse, - datadog::Error, + crate::datadogV2::model::TagPolicyScoreResponse, + datadog::Error, > { match self - .get_incident_service_with_http_info(service_id, params) + .get_tag_policy_score_with_http_info(policy_id, params) .await { Ok(response_content) => { @@ -467,43 +705,50 @@ impl IncidentServicesAPI { } } - /// Get details of an incident service. If the `include[users]` query parameter is provided, - /// the included attribute will contain the users related to these incident services. - pub async fn get_incident_service_with_http_info( + /// Retrieve the compliance score for a single tag policy. The score is computed over the + /// requested time window (or a source-appropriate default) and represents the percentage of + /// telemetry within that window that conforms to the policy. A `null` score indicates that + /// no relevant telemetry was found. + pub async fn get_tag_policy_score_with_http_info( &self, - service_id: String, - params: GetIncidentServiceOptionalParams, + policy_id: String, + params: GetTagPolicyScoreOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.get_incident_service"; + let operation_id = "v2.get_tag_policy_score"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.get_incident_service' is not enabled".to_string(), + msg: "Operation 'v2.get_tag_policy_score' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters - let include = params.include; + let ts_start = params.ts_start; + let ts_end = params.ts_end; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/services/{service_id}", + "{}/api/v2/tag-policies/{policy_id}/score", local_configuration.get_operation_host(operation_id), - service_id = datadog::urlencode(service_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - if let Some(ref local_query_param) = include { + if let Some(ref local_query_param) = ts_start { local_req_builder = - local_req_builder.query(&[("include", &local_query_param.to_string())]); + local_req_builder.query(&[("ts_start", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = ts_end { + local_req_builder = + local_req_builder.query(&[("ts_end", &local_query_param.to_string())]); }; // build headers @@ -548,7 +793,7 @@ impl IncidentServicesAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -561,7 +806,7 @@ impl IncidentServicesAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -572,15 +817,17 @@ impl IncidentServicesAPI { } } - /// Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services. - pub async fn list_incident_services( + /// Retrieve all tag policies for the organization. Optionally include disabled or deleted + /// policies, filter by telemetry source, and include each policy's current compliance score + /// via the `include=score` query parameter. + pub async fn list_tag_policies( &self, - params: ListIncidentServicesOptionalParams, + params: ListTagPoliciesOptionalParams, ) -> Result< - crate::datadogV2::model::IncidentServicesResponse, - datadog::Error, + crate::datadogV2::model::TagPoliciesListResponse, + datadog::Error, > { - match self.list_incident_services_with_http_info(params).await { + match self.list_tag_policies_with_http_info(params).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -594,55 +841,67 @@ impl IncidentServicesAPI { } } - /// Get all incident services uploaded for the requesting user's organization. If the `include[users]` query parameter is provided, the included attribute will contain the users related to these incident services. - pub async fn list_incident_services_with_http_info( + /// Retrieve all tag policies for the organization. Optionally include disabled or deleted + /// policies, filter by telemetry source, and include each policy's current compliance score + /// via the `include=score` query parameter. + pub async fn list_tag_policies_with_http_info( &self, - params: ListIncidentServicesOptionalParams, + params: ListTagPoliciesOptionalParams, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.list_incident_services"; + let operation_id = "v2.list_tag_policies"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.list_incident_services' is not enabled".to_string(), + msg: "Operation 'v2.list_tag_policies' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } // unbox and build optional parameters + let include_disabled = params.include_disabled; + let include_deleted = params.include_deleted; let include = params.include; - let page_size = params.page_size; - let page_offset = params.page_offset; - let filter = params.filter; + let filter_source = params.filter_source; + let ts_start = params.ts_start; + let ts_end = params.ts_end; let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/services", + "{}/api/v2/tag-policies", local_configuration.get_operation_host(operation_id) ); let mut local_req_builder = local_client.request(reqwest::Method::GET, local_uri_str.as_str()); + if let Some(ref local_query_param) = include_disabled { + local_req_builder = + local_req_builder.query(&[("include_disabled", &local_query_param.to_string())]); + }; + if let Some(ref local_query_param) = include_deleted { + local_req_builder = + local_req_builder.query(&[("include_deleted", &local_query_param.to_string())]); + }; if let Some(ref local_query_param) = include { local_req_builder = local_req_builder.query(&[("include", &local_query_param.to_string())]); }; - if let Some(ref local_query_param) = page_size { + if let Some(ref local_query_param) = filter_source { local_req_builder = - local_req_builder.query(&[("page[size]", &local_query_param.to_string())]); + local_req_builder.query(&[("filter[source]", &local_query_param.to_string())]); }; - if let Some(ref local_query_param) = page_offset { + if let Some(ref local_query_param) = ts_start { local_req_builder = - local_req_builder.query(&[("page[offset]", &local_query_param.to_string())]); + local_req_builder.query(&[("ts_start", &local_query_param.to_string())]); }; - if let Some(ref local_query_param) = filter { + if let Some(ref local_query_param) = ts_end { local_req_builder = - local_req_builder.query(&[("filter", &local_query_param.to_string())]); + local_req_builder.query(&[("ts_end", &local_query_param.to_string())]); }; // build headers @@ -687,7 +946,7 @@ impl IncidentServicesAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( + match serde_json::from_str::( &local_content, ) { Ok(e) => { @@ -700,7 +959,7 @@ impl IncidentServicesAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, @@ -711,19 +970,16 @@ impl IncidentServicesAPI { } } - /// Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update. - pub async fn update_incident_service( + /// Update one or more attributes of an existing tag policy. Only the fields supplied in the + /// request body are modified; omitted fields retain their current values. The policy's + /// `source` cannot be changed after creation. + pub async fn update_tag_policy( &self, - service_id: String, - body: crate::datadogV2::model::IncidentServiceUpdateRequest, - ) -> Result< - crate::datadogV2::model::IncidentServiceResponse, - datadog::Error, - > { - match self - .update_incident_service_with_http_info(service_id, body) - .await - { + policy_id: String, + body: crate::datadogV2::model::TagPolicyUpdateRequest, + ) -> Result> + { + match self.update_tag_policy_with_http_info(policy_id, body).await { Ok(response_content) => { if let Some(e) = response_content.entity { Ok(e) @@ -737,22 +993,24 @@ impl IncidentServicesAPI { } } - /// Updates an existing incident service. Only provide the attributes which should be updated as this request is a partial update. - pub async fn update_incident_service_with_http_info( + /// Update one or more attributes of an existing tag policy. Only the fields supplied in the + /// request body are modified; omitted fields retain their current values. The policy's + /// `source` cannot be changed after creation. + pub async fn update_tag_policy_with_http_info( &self, - service_id: String, - body: crate::datadogV2::model::IncidentServiceUpdateRequest, + policy_id: String, + body: crate::datadogV2::model::TagPolicyUpdateRequest, ) -> Result< - datadog::ResponseContent, - datadog::Error, + datadog::ResponseContent, + datadog::Error, > { let local_configuration = &self.config; - let operation_id = "v2.update_incident_service"; + let operation_id = "v2.update_tag_policy"; if local_configuration.is_unstable_operation_enabled(operation_id) { warn!("Using unstable operation {operation_id}"); } else { let local_error = datadog::UnstableOperationDisabledError { - msg: "Operation 'v2.update_incident_service' is not enabled".to_string(), + msg: "Operation 'v2.update_tag_policy' is not enabled".to_string(), }; return Err(datadog::Error::UnstableOperationDisabledError(local_error)); } @@ -760,9 +1018,9 @@ impl IncidentServicesAPI { let local_client = &self.client; let local_uri_str = format!( - "{}/api/v2/services/{service_id}", + "{}/api/v2/tag-policies/{policy_id}", local_configuration.get_operation_host(operation_id), - service_id = datadog::urlencode(service_id) + policy_id = datadog::urlencode(policy_id) ); let mut local_req_builder = local_client.request(reqwest::Method::PATCH, local_uri_str.as_str()); @@ -856,9 +1114,8 @@ impl IncidentServicesAPI { log::debug!("response content: {}", local_content); if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { + match serde_json::from_str::(&local_content) + { Ok(e) => { return Ok(datadog::ResponseContent { status: local_status, @@ -869,7 +1126,7 @@ impl IncidentServicesAPI { Err(e) => return Err(datadog::Error::Serde(e)), }; } else { - let local_entity: Option = + let local_entity: Option = serde_json::from_str(&local_content).ok(); let local_error = datadog::ResponseContent { status: local_status, diff --git a/src/datadogV2/api/mod.rs b/src/datadogV2/api/mod.rs index db96533187..8b5a79922d 100644 --- a/src/datadogV2/api/mod.rs +++ b/src/datadogV2/api/mod.rs @@ -43,6 +43,7 @@ pub mod api_dashboard_secure_embed; pub mod api_dashboard_sharing; pub mod api_dashboards; pub mod api_data_deletion; +pub mod api_data_observability; pub mod api_datasets; pub mod api_deployment_gates; pub mod api_domain_allowlist; @@ -59,7 +60,6 @@ pub mod api_forms; pub mod api_gcp_integration; pub mod api_google_chat_integration; pub mod api_high_availability_multi_region; -pub mod api_incident_services; pub mod api_incidents; pub mod api_integrations; pub mod api_ip_allowlist; @@ -104,7 +104,6 @@ pub mod api_rum_replay_playlists; pub mod api_rum_replay_sessions; pub mod api_rum_replay_viewership; pub mod api_rum_retention_filters; -pub mod api_rum_retention_filters_hardcoded; pub mod api_salesforce_integration; pub mod api_scorecards; pub mod api_seats; @@ -114,6 +113,7 @@ pub mod api_service_accounts; pub mod api_service_definition; pub mod api_service_level_objectives; pub mod api_service_now_integration; +pub mod api_slack_integration; pub mod api_software_catalog; pub mod api_spa; pub mod api_spans; @@ -124,6 +124,7 @@ pub mod api_statuspage_integration; pub mod api_stegadography; pub mod api_storage_management; pub mod api_synthetics; +pub mod api_tag_policies; pub mod api_teams; pub mod api_test_optimization; pub mod api_usage_metering; diff --git a/src/datadogV2/mod.rs b/src/datadogV2/mod.rs index a4bca2cc72..c180c25885 100644 --- a/src/datadogV2/mod.rs +++ b/src/datadogV2/mod.rs @@ -44,6 +44,7 @@ pub use self::api::api_dashboard_secure_embed; pub use self::api::api_dashboard_sharing; pub use self::api::api_dashboards; pub use self::api::api_data_deletion; +pub use self::api::api_data_observability; pub use self::api::api_datasets; pub use self::api::api_deployment_gates; pub use self::api::api_domain_allowlist; @@ -60,7 +61,6 @@ pub use self::api::api_forms; pub use self::api::api_gcp_integration; pub use self::api::api_google_chat_integration; pub use self::api::api_high_availability_multi_region; -pub use self::api::api_incident_services; pub use self::api::api_incidents; pub use self::api::api_integrations; pub use self::api::api_ip_allowlist; @@ -105,7 +105,6 @@ pub use self::api::api_rum_replay_playlists; pub use self::api::api_rum_replay_sessions; pub use self::api::api_rum_replay_viewership; pub use self::api::api_rum_retention_filters; -pub use self::api::api_rum_retention_filters_hardcoded; pub use self::api::api_salesforce_integration; pub use self::api::api_scorecards; pub use self::api::api_seats; @@ -115,6 +114,7 @@ pub use self::api::api_service_accounts; pub use self::api::api_service_definition; pub use self::api::api_service_level_objectives; pub use self::api::api_service_now_integration; +pub use self::api::api_slack_integration; pub use self::api::api_software_catalog; pub use self::api::api_spa; pub use self::api::api_spans; @@ -125,6 +125,7 @@ pub use self::api::api_statuspage_integration; pub use self::api::api_stegadography; pub use self::api::api_storage_management; pub use self::api::api_synthetics; +pub use self::api::api_tag_policies; pub use self::api::api_teams; pub use self::api::api_test_optimization; pub use self::api::api_usage_metering; diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index 08a9127a4a..1047471e0d 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -3380,6 +3380,20 @@ pub mod model_pagination_meta_page_type; pub use self::model_pagination_meta_page_type::PaginationMetaPageType; pub mod model_dashboard_usage_response; pub use self::model_dashboard_usage_response::DashboardUsageResponse; +pub mod model_get_data_observability_monitor_run_status_response; +pub use self::model_get_data_observability_monitor_run_status_response::GetDataObservabilityMonitorRunStatusResponse; +pub mod model_get_data_observability_monitor_run_status_response_data; +pub use self::model_get_data_observability_monitor_run_status_response_data::GetDataObservabilityMonitorRunStatusResponseData; +pub mod model_get_data_observability_monitor_run_status_response_attributes; +pub use self::model_get_data_observability_monitor_run_status_response_attributes::GetDataObservabilityMonitorRunStatusResponseAttributes; +pub mod model_data_observability_monitor_run_status; +pub use self::model_data_observability_monitor_run_status::DataObservabilityMonitorRunStatus; +pub mod model_data_observability_monitor_run_type; +pub use self::model_data_observability_monitor_run_type::DataObservabilityMonitorRunType; +pub mod model_run_data_observability_monitor_response; +pub use self::model_run_data_observability_monitor_response::RunDataObservabilityMonitorResponse; +pub mod model_run_data_observability_monitor_response_data; +pub use self::model_run_data_observability_monitor_response_data::RunDataObservabilityMonitorResponseData; pub mod model_dataset_response_multi; pub use self::model_dataset_response_multi::DatasetResponseMulti; pub mod model_dataset_response; @@ -4144,6 +4158,26 @@ pub mod model_upsert_and_publish_form_version_data_attributes; pub use self::model_upsert_and_publish_form_version_data_attributes::UpsertAndPublishFormVersionDataAttributes; pub mod model_upsert_and_publish_form_version_upsert_params; pub use self::model_upsert_and_publish_form_version_upsert_params::UpsertAndPublishFormVersionUpsertParams; +pub mod model_global_orgs_response; +pub use self::model_global_orgs_response::GlobalOrgsResponse; +pub mod model_global_org_data; +pub use self::model_global_org_data::GlobalOrgData; +pub mod model_global_org_attributes; +pub use self::model_global_org_attributes::GlobalOrgAttributes; +pub mod model_global_org; +pub use self::model_global_org::GlobalOrg; +pub mod model_global_org_user; +pub use self::model_global_org_user::GlobalOrgUser; +pub mod model_global_org_type; +pub use self::model_global_org_type::GlobalOrgType; +pub mod model_global_orgs_links; +pub use self::model_global_orgs_links::GlobalOrgsLinks; +pub mod model_global_orgs_meta; +pub use self::model_global_orgs_meta::GlobalOrgsMeta; +pub mod model_global_orgs_meta_page; +pub use self::model_global_orgs_meta_page::GlobalOrgsMetaPage; +pub mod model_global_orgs_meta_page_type; +pub use self::model_global_orgs_meta_page_type::GlobalOrgsMetaPageType; pub mod model_hamr_org_connection_response; pub use self::model_hamr_org_connection_response::HamrOrgConnectionResponse; pub mod model_hamr_org_connection_data_response; @@ -4874,6 +4908,22 @@ pub mod model_gcpsts_delegate_account_attributes; pub use self::model_gcpsts_delegate_account_attributes::GCPSTSDelegateAccountAttributes; pub mod model_gcpsts_delegate_account_type; pub use self::model_gcpsts_delegate_account_type::GCPSTSDelegateAccountType; +pub mod model_google_chat_organizations_response; +pub use self::model_google_chat_organizations_response::GoogleChatOrganizationsResponse; +pub mod model_google_chat_organization_data; +pub use self::model_google_chat_organization_data::GoogleChatOrganizationData; +pub mod model_google_chat_organization_attributes; +pub use self::model_google_chat_organization_attributes::GoogleChatOrganizationAttributes; +pub mod model_google_chat_organization_relationships; +pub use self::model_google_chat_organization_relationships::GoogleChatOrganizationRelationships; +pub mod model_google_chat_organization_relationships_delegated_user; +pub use self::model_google_chat_organization_relationships_delegated_user::GoogleChatOrganizationRelationshipsDelegatedUser; +pub mod model_google_chat_organization_relationships_delegated_user_data; +pub use self::model_google_chat_organization_relationships_delegated_user_data::GoogleChatOrganizationRelationshipsDelegatedUserData; +pub mod model_google_chat_delegated_user_type; +pub use self::model_google_chat_delegated_user_type::GoogleChatDelegatedUserType; +pub mod model_google_chat_organization_type; +pub use self::model_google_chat_organization_type::GoogleChatOrganizationType; pub mod model_google_chat_app_named_space_response; pub use self::model_google_chat_app_named_space_response::GoogleChatAppNamedSpaceResponse; pub mod model_google_chat_app_named_space_response_data; @@ -4882,6 +4932,14 @@ pub mod model_google_chat_app_named_space_response_attributes; pub use self::model_google_chat_app_named_space_response_attributes::GoogleChatAppNamedSpaceResponseAttributes; pub mod model_google_chat_app_named_space_type; pub use self::model_google_chat_app_named_space_type::GoogleChatAppNamedSpaceType; +pub mod model_google_chat_organization_response; +pub use self::model_google_chat_organization_response::GoogleChatOrganizationResponse; +pub mod model_google_chat_delegated_user_response; +pub use self::model_google_chat_delegated_user_response::GoogleChatDelegatedUserResponse; +pub mod model_google_chat_delegated_user_data; +pub use self::model_google_chat_delegated_user_data::GoogleChatDelegatedUserData; +pub mod model_google_chat_delegated_user_attributes; +pub use self::model_google_chat_delegated_user_attributes::GoogleChatDelegatedUserAttributes; pub mod model_google_chat_organization_handles_response; pub use self::model_google_chat_organization_handles_response::GoogleChatOrganizationHandlesResponse; pub mod model_google_chat_organization_handle_response_data; @@ -4904,6 +4962,28 @@ pub mod model_google_chat_update_organization_handle_request_data; pub use self::model_google_chat_update_organization_handle_request_data::GoogleChatUpdateOrganizationHandleRequestData; pub mod model_google_chat_update_organization_handle_request_attributes; pub use self::model_google_chat_update_organization_handle_request_attributes::GoogleChatUpdateOrganizationHandleRequestAttributes; +pub mod model_google_chat_target_audiences_response; +pub use self::model_google_chat_target_audiences_response::GoogleChatTargetAudiencesResponse; +pub mod model_google_chat_target_audience_data; +pub use self::model_google_chat_target_audience_data::GoogleChatTargetAudienceData; +pub mod model_google_chat_target_audience_attributes; +pub use self::model_google_chat_target_audience_attributes::GoogleChatTargetAudienceAttributes; +pub mod model_google_chat_target_audience_type; +pub use self::model_google_chat_target_audience_type::GoogleChatTargetAudienceType; +pub mod model_google_chat_target_audience_create_request; +pub use self::model_google_chat_target_audience_create_request::GoogleChatTargetAudienceCreateRequest; +pub mod model_google_chat_target_audience_create_request_data; +pub use self::model_google_chat_target_audience_create_request_data::GoogleChatTargetAudienceCreateRequestData; +pub mod model_google_chat_target_audience_create_request_attributes; +pub use self::model_google_chat_target_audience_create_request_attributes::GoogleChatTargetAudienceCreateRequestAttributes; +pub mod model_google_chat_target_audience_response; +pub use self::model_google_chat_target_audience_response::GoogleChatTargetAudienceResponse; +pub mod model_google_chat_target_audience_update_request; +pub use self::model_google_chat_target_audience_update_request::GoogleChatTargetAudienceUpdateRequest; +pub mod model_google_chat_target_audience_update_request_data; +pub use self::model_google_chat_target_audience_update_request_data::GoogleChatTargetAudienceUpdateRequestData; +pub mod model_google_chat_target_audience_update_request_attributes; +pub use self::model_google_chat_target_audience_update_request_attributes::GoogleChatTargetAudienceUpdateRequestAttributes; pub mod model_jira_accounts_response; pub use self::model_jira_accounts_response::JiraAccountsResponse; pub mod model_jira_account_data; @@ -5184,6 +5264,12 @@ pub mod model_service_now_user_attributes; pub use self::model_service_now_user_attributes::ServiceNowUserAttributes; pub mod model_service_now_user_type; pub use self::model_service_now_user_type::ServiceNowUserType; +pub mod model_slack_user_bindings_response; +pub use self::model_slack_user_bindings_response::SlackUserBindingsResponse; +pub mod model_slack_user_binding_data; +pub use self::model_slack_user_binding_data::SlackUserBindingData; +pub mod model_slack_user_binding_type; +pub use self::model_slack_user_binding_type::SlackUserBindingType; pub mod model_statuspage_account_response; pub use self::model_statuspage_account_response::StatuspageAccountResponse; pub mod model_statuspage_account_response_data; @@ -5846,6 +5932,100 @@ pub mod model_llm_obs_span_page_query; pub use self::model_llm_obs_span_page_query::LLMObsSpanPageQuery; pub mod model_llm_obs_search_spans_request_type; pub use self::model_llm_obs_search_spans_request_type::LLMObsSearchSpansRequestType; +pub mod model_llm_obs_patterns_clustered_points_response; +pub use self::model_llm_obs_patterns_clustered_points_response::LLMObsPatternsClusteredPointsResponse; +pub mod model_llm_obs_patterns_clustered_points_response_data; +pub use self::model_llm_obs_patterns_clustered_points_response_data::LLMObsPatternsClusteredPointsResponseData; +pub mod model_llm_obs_patterns_clustered_points_response_attributes; +pub use self::model_llm_obs_patterns_clustered_points_response_attributes::LLMObsPatternsClusteredPointsResponseAttributes; +pub mod model_llm_obs_patterns_clustered_point; +pub use self::model_llm_obs_patterns_clustered_point::LLMObsPatternsClusteredPoint; +pub mod model_llm_obs_patterns_clustered_points_type; +pub use self::model_llm_obs_patterns_clustered_points_type::LLMObsPatternsClusteredPointsType; +pub mod model_llm_obs_patterns_configs_response; +pub use self::model_llm_obs_patterns_configs_response::LLMObsPatternsConfigsResponse; +pub mod model_llm_obs_patterns_configs_response_data; +pub use self::model_llm_obs_patterns_configs_response_data::LLMObsPatternsConfigsResponseData; +pub mod model_llm_obs_patterns_configs_response_attributes; +pub use self::model_llm_obs_patterns_configs_response_attributes::LLMObsPatternsConfigsResponseAttributes; +pub mod model_llm_obs_patterns_config_item; +pub use self::model_llm_obs_patterns_config_item::LLMObsPatternsConfigItem; +pub mod model_llm_obs_patterns_configs_list_type; +pub use self::model_llm_obs_patterns_configs_list_type::LLMObsPatternsConfigsListType; +pub mod model_llm_obs_patterns_config_upsert_request; +pub use self::model_llm_obs_patterns_config_upsert_request::LLMObsPatternsConfigUpsertRequest; +pub mod model_llm_obs_patterns_config_upsert_request_data; +pub use self::model_llm_obs_patterns_config_upsert_request_data::LLMObsPatternsConfigUpsertRequestData; +pub mod model_llm_obs_patterns_config_upsert_request_attributes; +pub use self::model_llm_obs_patterns_config_upsert_request_attributes::LLMObsPatternsConfigUpsertRequestAttributes; +pub mod model_llm_obs_patterns_config_type; +pub use self::model_llm_obs_patterns_config_type::LLMObsPatternsConfigType; +pub mod model_llm_obs_patterns_config_response; +pub use self::model_llm_obs_patterns_config_response::LLMObsPatternsConfigResponse; +pub mod model_llm_obs_patterns_config_response_data; +pub use self::model_llm_obs_patterns_config_response_data::LLMObsPatternsConfigResponseData; +pub mod model_llm_obs_patterns_config_attributes; +pub use self::model_llm_obs_patterns_config_attributes::LLMObsPatternsConfigAttributes; +pub mod model_llm_obs_patterns_runs_response; +pub use self::model_llm_obs_patterns_runs_response::LLMObsPatternsRunsResponse; +pub mod model_llm_obs_patterns_runs_response_data; +pub use self::model_llm_obs_patterns_runs_response_data::LLMObsPatternsRunsResponseData; +pub mod model_llm_obs_patterns_runs_response_attributes; +pub use self::model_llm_obs_patterns_runs_response_attributes::LLMObsPatternsRunsResponseAttributes; +pub mod model_llm_obs_patterns_run_summary; +pub use self::model_llm_obs_patterns_run_summary::LLMObsPatternsRunSummary; +pub mod model_llm_obs_patterns_config_snapshot; +pub use self::model_llm_obs_patterns_config_snapshot::LLMObsPatternsConfigSnapshot; +pub mod model_llm_obs_patterns_runs_list_type; +pub use self::model_llm_obs_patterns_runs_list_type::LLMObsPatternsRunsListType; +pub mod model_llm_obs_patterns_trigger_request; +pub use self::model_llm_obs_patterns_trigger_request::LLMObsPatternsTriggerRequest; +pub mod model_llm_obs_patterns_trigger_request_data; +pub use self::model_llm_obs_patterns_trigger_request_data::LLMObsPatternsTriggerRequestData; +pub mod model_llm_obs_patterns_trigger_request_attributes; +pub use self::model_llm_obs_patterns_trigger_request_attributes::LLMObsPatternsTriggerRequestAttributes; +pub mod model_llm_obs_patterns_request_type; +pub use self::model_llm_obs_patterns_request_type::LLMObsPatternsRequestType; +pub mod model_llm_obs_patterns_trigger_response; +pub use self::model_llm_obs_patterns_trigger_response::LLMObsPatternsTriggerResponse; +pub mod model_llm_obs_patterns_trigger_response_data; +pub use self::model_llm_obs_patterns_trigger_response_data::LLMObsPatternsTriggerResponseData; +pub mod model_llm_obs_patterns_trigger_response_attributes; +pub use self::model_llm_obs_patterns_trigger_response_attributes::LLMObsPatternsTriggerResponseAttributes; +pub mod model_llm_obs_patterns_trigger_response_type; +pub use self::model_llm_obs_patterns_trigger_response_type::LLMObsPatternsTriggerResponseType; +pub mod model_llm_obs_patterns_run_status_response; +pub use self::model_llm_obs_patterns_run_status_response::LLMObsPatternsRunStatusResponse; +pub mod model_llm_obs_patterns_run_status_response_data; +pub use self::model_llm_obs_patterns_run_status_response_data::LLMObsPatternsRunStatusResponseData; +pub mod model_llm_obs_patterns_run_status_response_attributes; +pub use self::model_llm_obs_patterns_run_status_response_attributes::LLMObsPatternsRunStatusResponseAttributes; +pub mod model_llm_obs_patterns_activity_progress; +pub use self::model_llm_obs_patterns_activity_progress::LLMObsPatternsActivityProgress; +pub mod model_llm_obs_patterns_run_status_type; +pub use self::model_llm_obs_patterns_run_status_type::LLMObsPatternsRunStatusType; +pub mod model_llm_obs_patterns_topics_response; +pub use self::model_llm_obs_patterns_topics_response::LLMObsPatternsTopicsResponse; +pub mod model_llm_obs_patterns_topics_response_data; +pub use self::model_llm_obs_patterns_topics_response_data::LLMObsPatternsTopicsResponseData; +pub mod model_llm_obs_patterns_topics_response_attributes; +pub use self::model_llm_obs_patterns_topics_response_attributes::LLMObsPatternsTopicsResponseAttributes; +pub mod model_llm_obs_patterns_topic; +pub use self::model_llm_obs_patterns_topic::LLMObsPatternsTopic; +pub mod model_llm_obs_patterns_topics_type; +pub use self::model_llm_obs_patterns_topics_type::LLMObsPatternsTopicsType; +pub mod model_llm_obs_patterns_topics_with_clustered_points_response; +pub use self::model_llm_obs_patterns_topics_with_clustered_points_response::LLMObsPatternsTopicsWithClusteredPointsResponse; +pub mod model_llm_obs_patterns_topics_with_clustered_points_response_data; +pub use self::model_llm_obs_patterns_topics_with_clustered_points_response_data::LLMObsPatternsTopicsWithClusteredPointsResponseData; +pub mod model_llm_obs_patterns_topics_with_clustered_points_response_attributes; +pub use self::model_llm_obs_patterns_topics_with_clustered_points_response_attributes::LLMObsPatternsTopicsWithClusteredPointsResponseAttributes; +pub mod model_llm_obs_patterns_topic_with_clustered_points; +pub use self::model_llm_obs_patterns_topic_with_clustered_points::LLMObsPatternsTopicWithClusteredPoints; +pub mod model_llm_obs_patterns_clustered_point_ref; +pub use self::model_llm_obs_patterns_clustered_point_ref::LLMObsPatternsClusteredPointRef; +pub mod model_llm_obs_patterns_topics_with_clustered_points_type; +pub use self::model_llm_obs_patterns_topics_with_clustered_points_type::LLMObsPatternsTopicsWithClusteredPointsType; pub mod model_llm_obs_datasets_response; pub use self::model_llm_obs_datasets_response::LLMObsDatasetsResponse; pub mod model_llm_obs_dataset_request; @@ -5952,6 +6132,14 @@ pub mod model_llm_obs_experiment_events_type; pub use self::model_llm_obs_experiment_events_type::LLMObsExperimentEventsType; pub mod model_llm_obs_dataset_records_upload_file; pub use self::model_llm_obs_dataset_records_upload_file::LLMObsDatasetRecordsUploadFile; +pub mod model_max_session_duration_update_request; +pub use self::model_max_session_duration_update_request::MaxSessionDurationUpdateRequest; +pub mod model_max_session_duration_update_data; +pub use self::model_max_session_duration_update_data::MaxSessionDurationUpdateData; +pub mod model_max_session_duration_update_attributes; +pub use self::model_max_session_duration_update_attributes::MaxSessionDurationUpdateAttributes; +pub mod model_max_session_duration_type; +pub use self::model_max_session_duration_type::MaxSessionDurationType; pub mod model_content_encoding; pub use self::model_content_encoding::ContentEncoding; pub mod model_http_log_item; @@ -7108,6 +7296,10 @@ pub mod model_observability_pipeline_metric_value; pub use self::model_observability_pipeline_metric_value::ObservabilityPipelineMetricValue; pub mod model_observability_pipeline_generate_metrics_processor_type; pub use self::model_observability_pipeline_generate_metrics_processor_type::ObservabilityPipelineGenerateMetricsProcessorType; +pub mod model_observability_pipeline_generate_metrics_v2_processor; +pub use self::model_observability_pipeline_generate_metrics_v2_processor::ObservabilityPipelineGenerateMetricsV2Processor; +pub mod model_observability_pipeline_generate_metrics_v2_processor_type; +pub use self::model_observability_pipeline_generate_metrics_v2_processor_type::ObservabilityPipelineGenerateMetricsV2ProcessorType; pub mod model_observability_pipeline_ocsf_mapper_processor; pub use self::model_observability_pipeline_ocsf_mapper_processor::ObservabilityPipelineOcsfMapperProcessor; pub mod model_observability_pipeline_ocsf_mapper_processor_mapping; @@ -9068,34 +9260,6 @@ pub mod model_rum_application_attributes; pub use self::model_rum_application_attributes::RUMApplicationAttributes; pub mod model_rum_application_type; pub use self::model_rum_application_type::RUMApplicationType; -pub mod model_rum_hardcoded_retention_filters_response; -pub use self::model_rum_hardcoded_retention_filters_response::RumHardcodedRetentionFiltersResponse; -pub mod model_rum_hardcoded_retention_filter_data; -pub use self::model_rum_hardcoded_retention_filter_data::RumHardcodedRetentionFilterData; -pub mod model_rum_hardcoded_retention_filter_attributes; -pub use self::model_rum_hardcoded_retention_filter_attributes::RumHardcodedRetentionFilterAttributes; -pub mod model_rum_hardcoded_cross_product_sampling; -pub use self::model_rum_hardcoded_cross_product_sampling::RumHardcodedCrossProductSampling; -pub mod model_rum_hardcoded_cross_product_sampling_editability; -pub use self::model_rum_hardcoded_cross_product_sampling_editability::RumHardcodedCrossProductSamplingEditability; -pub mod model_rum_hardcoded_retention_filter_event_type; -pub use self::model_rum_hardcoded_retention_filter_event_type::RumHardcodedRetentionFilterEventType; -pub mod model_rum_hardcoded_retention_filter_meta; -pub use self::model_rum_hardcoded_retention_filter_meta::RumHardcodedRetentionFilterMeta; -pub mod model_rum_hardcoded_retention_filter_meta_source; -pub use self::model_rum_hardcoded_retention_filter_meta_source::RumHardcodedRetentionFilterMetaSource; -pub mod model_rum_hardcoded_retention_filter_type; -pub use self::model_rum_hardcoded_retention_filter_type::RumHardcodedRetentionFilterType; -pub mod model_rum_hardcoded_retention_filter_response; -pub use self::model_rum_hardcoded_retention_filter_response::RumHardcodedRetentionFilterResponse; -pub mod model_rum_hardcoded_retention_filter_update_request; -pub use self::model_rum_hardcoded_retention_filter_update_request::RumHardcodedRetentionFilterUpdateRequest; -pub mod model_rum_hardcoded_retention_filter_update_data; -pub use self::model_rum_hardcoded_retention_filter_update_data::RumHardcodedRetentionFilterUpdateData; -pub mod model_rum_hardcoded_retention_filter_update_attributes; -pub use self::model_rum_hardcoded_retention_filter_update_attributes::RumHardcodedRetentionFilterUpdateAttributes; -pub mod model_rum_hardcoded_cross_product_sampling_update; -pub use self::model_rum_hardcoded_cross_product_sampling_update::RumHardcodedCrossProductSamplingUpdate; pub mod model_rum_retention_filters_order_request; pub use self::model_rum_retention_filters_order_request::RumRetentionFiltersOrderRequest; pub mod model_rum_retention_filters_order_data; @@ -10672,26 +10836,6 @@ pub mod model_service_account_access_token_update_attributes; pub use self::model_service_account_access_token_update_attributes::ServiceAccountAccessTokenUpdateAttributes; pub mod model_partial_application_key_response; pub use self::model_partial_application_key_response::PartialApplicationKeyResponse; -pub mod model_incident_services_response; -pub use self::model_incident_services_response::IncidentServicesResponse; -pub mod model_incident_service_response_data; -pub use self::model_incident_service_response_data::IncidentServiceResponseData; -pub mod model_incident_service_response_attributes; -pub use self::model_incident_service_response_attributes::IncidentServiceResponseAttributes; -pub mod model_incident_service_relationships; -pub use self::model_incident_service_relationships::IncidentServiceRelationships; -pub mod model_incident_service_type; -pub use self::model_incident_service_type::IncidentServiceType; -pub mod model_incident_service_included_items; -pub use self::model_incident_service_included_items::IncidentServiceIncludedItems; -pub mod model_incident_service_create_request; -pub use self::model_incident_service_create_request::IncidentServiceCreateRequest; -pub mod model_incident_service_create_data; -pub use self::model_incident_service_create_data::IncidentServiceCreateData; -pub mod model_incident_service_create_attributes; -pub use self::model_incident_service_create_attributes::IncidentServiceCreateAttributes; -pub mod model_incident_service_response; -pub use self::model_incident_service_response::IncidentServiceResponse; pub mod model_service_definition_schema_versions; pub use self::model_service_definition_schema_versions::ServiceDefinitionSchemaVersions; pub mod model_service_definitions_list_response; @@ -10806,12 +10950,6 @@ pub mod model_service_definition_create_response; pub use self::model_service_definition_create_response::ServiceDefinitionCreateResponse; pub mod model_service_definition_get_response; pub use self::model_service_definition_get_response::ServiceDefinitionGetResponse; -pub mod model_incident_service_update_request; -pub use self::model_incident_service_update_request::IncidentServiceUpdateRequest; -pub mod model_incident_service_update_data; -pub use self::model_incident_service_update_data::IncidentServiceUpdateData; -pub mod model_incident_service_update_attributes; -pub use self::model_incident_service_update_attributes::IncidentServiceUpdateAttributes; pub mod model_list_historical_jobs_response; pub use self::model_list_historical_jobs_response::ListHistoricalJobsResponse; pub mod model_historical_job_response_data; @@ -12120,6 +12258,50 @@ pub mod model_synthetics_global_variable_totp_parameters; pub use self::model_synthetics_global_variable_totp_parameters::SyntheticsGlobalVariableTOTPParameters; pub mod model_global_variable_type; pub use self::model_global_variable_type::GlobalVariableType; +pub mod model_tag_policy_include; +pub use self::model_tag_policy_include::TagPolicyInclude; +pub mod model_tag_policy_source; +pub use self::model_tag_policy_source::TagPolicySource; +pub mod model_tag_policies_list_response; +pub use self::model_tag_policies_list_response::TagPoliciesListResponse; +pub mod model_tag_policy_data; +pub use self::model_tag_policy_data::TagPolicyData; +pub mod model_tag_policy_attributes; +pub use self::model_tag_policy_attributes::TagPolicyAttributes; +pub mod model_tag_policy_type; +pub use self::model_tag_policy_type::TagPolicyType; +pub mod model_tag_policy_relationships; +pub use self::model_tag_policy_relationships::TagPolicyRelationships; +pub mod model_tag_policy_score_relationship; +pub use self::model_tag_policy_score_relationship::TagPolicyScoreRelationship; +pub mod model_tag_policy_score_relationship_data; +pub use self::model_tag_policy_score_relationship_data::TagPolicyScoreRelationshipData; +pub mod model_tag_policy_score_resource_type; +pub use self::model_tag_policy_score_resource_type::TagPolicyScoreResourceType; +pub mod model_tag_policy_resource_type; +pub use self::model_tag_policy_resource_type::TagPolicyResourceType; +pub mod model_tag_policy_score_data; +pub use self::model_tag_policy_score_data::TagPolicyScoreData; +pub mod model_tag_policy_score_attributes; +pub use self::model_tag_policy_score_attributes::TagPolicyScoreAttributes; +pub mod model_tag_policy_create_request; +pub use self::model_tag_policy_create_request::TagPolicyCreateRequest; +pub mod model_tag_policy_create_data; +pub use self::model_tag_policy_create_data::TagPolicyCreateData; +pub mod model_tag_policy_create_attributes; +pub use self::model_tag_policy_create_attributes::TagPolicyCreateAttributes; +pub mod model_tag_policy_create_type; +pub use self::model_tag_policy_create_type::TagPolicyCreateType; +pub mod model_tag_policy_response; +pub use self::model_tag_policy_response::TagPolicyResponse; +pub mod model_tag_policy_update_request; +pub use self::model_tag_policy_update_request::TagPolicyUpdateRequest; +pub mod model_tag_policy_update_data; +pub use self::model_tag_policy_update_data::TagPolicyUpdateData; +pub mod model_tag_policy_update_attributes; +pub use self::model_tag_policy_update_attributes::TagPolicyUpdateAttributes; +pub mod model_tag_policy_score_response; +pub use self::model_tag_policy_score_response::TagPolicyScoreResponse; pub mod model_ruleset_resp_array; pub use self::model_ruleset_resp_array::RulesetRespArray; pub mod model_ruleset_resp_data; diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_event_type.rs b/src/datadogV2/model/model_data_observability_monitor_run_status.rs similarity index 60% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_event_type.rs rename to src/datadogV2/model/model_data_observability_monitor_run_status.rs index 92a131886c..fad90694fd 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_event_type.rs +++ b/src/datadogV2/model/model_data_observability_monitor_run_status.rs @@ -6,33 +6,29 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[non_exhaustive] #[derive(Clone, Debug, Eq, PartialEq)] -pub enum RumHardcodedRetentionFilterEventType { - SESSION, - VIEW, - ACTION, +pub enum DataObservabilityMonitorRunStatus { + PENDING, + OK, + WARN, + ALERT, ERROR, - RESOURCE, - LONG_TASK, - VITAL, UnparsedObject(crate::datadog::UnparsedObject), } -impl ToString for RumHardcodedRetentionFilterEventType { +impl ToString for DataObservabilityMonitorRunStatus { fn to_string(&self) -> String { match self { - Self::SESSION => String::from("session"), - Self::VIEW => String::from("view"), - Self::ACTION => String::from("action"), + Self::PENDING => String::from("pending"), + Self::OK => String::from("ok"), + Self::WARN => String::from("warn"), + Self::ALERT => String::from("alert"), Self::ERROR => String::from("error"), - Self::RESOURCE => String::from("resource"), - Self::LONG_TASK => String::from("long_task"), - Self::VITAL => String::from("vital"), Self::UnparsedObject(v) => v.value.to_string(), } } } -impl Serialize for RumHardcodedRetentionFilterEventType { +impl Serialize for DataObservabilityMonitorRunStatus { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -44,20 +40,18 @@ impl Serialize for RumHardcodedRetentionFilterEventType { } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterEventType { +impl<'de> Deserialize<'de> for DataObservabilityMonitorRunStatus { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { let s: String = String::deserialize(deserializer)?; Ok(match s.as_str() { - "session" => Self::SESSION, - "view" => Self::VIEW, - "action" => Self::ACTION, + "pending" => Self::PENDING, + "ok" => Self::OK, + "warn" => Self::WARN, + "alert" => Self::ALERT, "error" => Self::ERROR, - "resource" => Self::RESOURCE, - "long_task" => Self::LONG_TASK, - "vital" => Self::VITAL, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }), diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_type.rs b/src/datadogV2/model/model_data_observability_monitor_run_type.rs similarity index 74% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_type.rs rename to src/datadogV2/model/model_data_observability_monitor_run_type.rs index 74370e6e73..f1e23063f0 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_type.rs +++ b/src/datadogV2/model/model_data_observability_monitor_run_type.rs @@ -6,21 +6,21 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[non_exhaustive] #[derive(Clone, Debug, Eq, PartialEq)] -pub enum RumHardcodedRetentionFilterType { - HARDCODED_RETENTION_FILTERS, +pub enum DataObservabilityMonitorRunType { + MONITOR_RUN, UnparsedObject(crate::datadog::UnparsedObject), } -impl ToString for RumHardcodedRetentionFilterType { +impl ToString for DataObservabilityMonitorRunType { fn to_string(&self) -> String { match self { - Self::HARDCODED_RETENTION_FILTERS => String::from("hardcoded_retention_filters"), + Self::MONITOR_RUN => String::from("monitor_run"), Self::UnparsedObject(v) => v.value.to_string(), } } } -impl Serialize for RumHardcodedRetentionFilterType { +impl Serialize for DataObservabilityMonitorRunType { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -32,14 +32,14 @@ impl Serialize for RumHardcodedRetentionFilterType { } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterType { +impl<'de> Deserialize<'de> for DataObservabilityMonitorRunType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { let s: String = String::deserialize(deserializer)?; Ok(match s.as_str() { - "hardcoded_retention_filters" => Self::HARDCODED_RETENTION_FILTERS, + "monitor_run" => Self::MONITOR_RUN, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }), diff --git a/src/datadogV2/model/model_get_data_observability_monitor_run_status_response.rs b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response.rs new file mode 100644 index 0000000000..ce0ce799c5 --- /dev/null +++ b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response.rs @@ -0,0 +1,96 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The response for getting the status of a data observability monitor run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GetDataObservabilityMonitorRunStatusResponse { + /// The data object for a data observability monitor run status response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GetDataObservabilityMonitorRunStatusResponse { + pub fn new( + data: crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseData, + ) -> GetDataObservabilityMonitorRunStatusResponse { + GetDataObservabilityMonitorRunStatusResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GetDataObservabilityMonitorRunStatusResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GetDataObservabilityMonitorRunStatusResponseVisitor; + impl<'a> Visitor<'a> for GetDataObservabilityMonitorRunStatusResponseVisitor { + type Value = GetDataObservabilityMonitorRunStatusResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option< + crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseData, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GetDataObservabilityMonitorRunStatusResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GetDataObservabilityMonitorRunStatusResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_attributes.rs b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_attributes.rs new file mode 100644 index 0000000000..84b67bfd3f --- /dev/null +++ b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_attributes.rs @@ -0,0 +1,121 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The attributes of a data observability monitor run status response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GetDataObservabilityMonitorRunStatusResponseAttributes { + /// Error message describing why the monitor run failed. Only present when status is error. + #[serde(rename = "error_message")] + pub error_message: Option, + /// The status of a data observability monitor run. + #[serde(rename = "status")] + pub status: crate::datadogV2::model::DataObservabilityMonitorRunStatus, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GetDataObservabilityMonitorRunStatusResponseAttributes { + pub fn new( + status: crate::datadogV2::model::DataObservabilityMonitorRunStatus, + ) -> GetDataObservabilityMonitorRunStatusResponseAttributes { + GetDataObservabilityMonitorRunStatusResponseAttributes { + error_message: None, + status, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn error_message(mut self, value: String) -> Self { + self.error_message = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GetDataObservabilityMonitorRunStatusResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GetDataObservabilityMonitorRunStatusResponseAttributesVisitor; + impl<'a> Visitor<'a> for GetDataObservabilityMonitorRunStatusResponseAttributesVisitor { + type Value = GetDataObservabilityMonitorRunStatusResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut error_message: Option = None; + let mut status: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "error_message" => { + if v.is_null() { + continue; + } + error_message = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + status = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _status) = status { + match _status { + crate::datadogV2::model::DataObservabilityMonitorRunStatus::UnparsedObject(_status) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; + + let content = GetDataObservabilityMonitorRunStatusResponseAttributes { + error_message, + status, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GetDataObservabilityMonitorRunStatusResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_data.rs b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_data.rs new file mode 100644 index 0000000000..7a6028162e --- /dev/null +++ b/src/datadogV2/model/model_get_data_observability_monitor_run_status_response_data.rs @@ -0,0 +1,127 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The data object for a data observability monitor run status response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GetDataObservabilityMonitorRunStatusResponseData { + /// The attributes of a data observability monitor run status response. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseAttributes, + /// The unique identifier of the monitor run. + #[serde(rename = "id")] + pub id: String, + /// The JSON:API resource type for a data observability monitor run. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::DataObservabilityMonitorRunType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GetDataObservabilityMonitorRunStatusResponseData { + pub fn new( + attributes: crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseAttributes, + id: String, + type_: crate::datadogV2::model::DataObservabilityMonitorRunType, + ) -> GetDataObservabilityMonitorRunStatusResponseData { + GetDataObservabilityMonitorRunStatusResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GetDataObservabilityMonitorRunStatusResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GetDataObservabilityMonitorRunStatusResponseDataVisitor; + impl<'a> Visitor<'a> for GetDataObservabilityMonitorRunStatusResponseDataVisitor { + type Value = GetDataObservabilityMonitorRunStatusResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::GetDataObservabilityMonitorRunStatusResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::DataObservabilityMonitorRunType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = GetDataObservabilityMonitorRunStatusResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GetDataObservabilityMonitorRunStatusResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_global_org.rs b/src/datadogV2/model/model_global_org.rs new file mode 100644 index 0000000000..98b11983b1 --- /dev/null +++ b/src/datadogV2/model/model_global_org.rs @@ -0,0 +1,138 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Organization information for a global organization association. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrg { + /// The name of the organization. + #[serde(rename = "name")] + pub name: String, + /// The public identifier of the organization. + #[serde( + rename = "public_id", + default, + with = "::serde_with::rust::double_option" + )] + pub public_id: Option>, + /// The subdomain used to access the organization, if configured. + #[serde( + rename = "subdomain", + default, + with = "::serde_with::rust::double_option" + )] + pub subdomain: Option>, + /// The UUID of the organization. + #[serde(rename = "uuid")] + pub uuid: uuid::Uuid, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrg { + pub fn new(name: String, uuid: uuid::Uuid) -> GlobalOrg { + GlobalOrg { + name, + public_id: None, + subdomain: None, + uuid, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn public_id(mut self, value: Option) -> Self { + self.public_id = Some(value); + self + } + + pub fn subdomain(mut self, value: Option) -> Self { + self.subdomain = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GlobalOrg { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgVisitor; + impl<'a> Visitor<'a> for GlobalOrgVisitor { + type Value = GlobalOrg; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut name: Option = None; + let mut public_id: Option> = None; + let mut subdomain: Option> = None; + let mut uuid: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "public_id" => { + public_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "subdomain" => { + subdomain = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "uuid" => { + uuid = 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); + } + } + } + } + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let uuid = uuid.ok_or_else(|| M::Error::missing_field("uuid"))?; + + let content = GlobalOrg { + name, + public_id, + subdomain, + uuid, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgVisitor) + } +} diff --git a/src/datadogV2/model/model_global_org_attributes.rs b/src/datadogV2/model/model_global_org_attributes.rs new file mode 100644 index 0000000000..de98450031 --- /dev/null +++ b/src/datadogV2/model/model_global_org_attributes.rs @@ -0,0 +1,137 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an organization associated with the authenticated user. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrgAttributes { + /// Organization information for a global organization association. + #[serde(rename = "org")] + pub org: crate::datadogV2::model::GlobalOrg, + /// The login URL used to switch into the organization, if available. + #[serde( + rename = "redirect_url", + default, + with = "::serde_with::rust::double_option" + )] + pub redirect_url: Option>, + /// The source region of the organization. + #[serde(rename = "source_region")] + pub source_region: String, + /// User information for a global organization association. + #[serde(rename = "user")] + pub user: crate::datadogV2::model::GlobalOrgUser, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrgAttributes { + pub fn new( + org: crate::datadogV2::model::GlobalOrg, + source_region: String, + user: crate::datadogV2::model::GlobalOrgUser, + ) -> GlobalOrgAttributes { + GlobalOrgAttributes { + org, + redirect_url: None, + source_region, + user, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn redirect_url(mut self, value: Option) -> Self { + self.redirect_url = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GlobalOrgAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgAttributesVisitor; + impl<'a> Visitor<'a> for GlobalOrgAttributesVisitor { + type Value = GlobalOrgAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut org: Option = None; + let mut redirect_url: Option> = None; + let mut source_region: Option = None; + let mut user: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "org" => { + org = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "redirect_url" => { + redirect_url = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "source_region" => { + source_region = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "user" => { + user = 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); + } + } + } + } + let org = org.ok_or_else(|| M::Error::missing_field("org"))?; + let source_region = + source_region.ok_or_else(|| M::Error::missing_field("source_region"))?; + let user = user.ok_or_else(|| M::Error::missing_field("user"))?; + + let content = GlobalOrgAttributes { + org, + redirect_url, + source_region, + user, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_global_org_data.rs b/src/datadogV2/model/model_global_org_data.rs new file mode 100644 index 0000000000..5cb7c39190 --- /dev/null +++ b/src/datadogV2/model/model_global_org_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// An organization associated with the authenticated user. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrgData { + /// Attributes of an organization associated with the authenticated user. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::GlobalOrgAttributes, + /// The resource type for global user organizations. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::GlobalOrgType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrgData { + pub fn new( + attributes: crate::datadogV2::model::GlobalOrgAttributes, + type_: crate::datadogV2::model::GlobalOrgType, + ) -> GlobalOrgData { + GlobalOrgData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GlobalOrgData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgDataVisitor; + impl<'a> Visitor<'a> for GlobalOrgDataVisitor { + type Value = GlobalOrgData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::GlobalOrgType::UnparsedObject( + _type_, + ) => { + _unparsed = true; + } + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = GlobalOrgData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgDataVisitor) + } +} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_meta_source.rs b/src/datadogV2/model/model_global_org_type.rs similarity index 68% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_meta_source.rs rename to src/datadogV2/model/model_global_org_type.rs index e8a507a96e..6f1ed6782b 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_meta_source.rs +++ b/src/datadogV2/model/model_global_org_type.rs @@ -6,25 +6,21 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[non_exhaustive] #[derive(Clone, Debug, Eq, PartialEq)] -pub enum RumHardcodedRetentionFilterMetaSource { - DEFAULT, - UI, - TERRAFORM, +pub enum GlobalOrgType { + GLOBAL_USER_ORGS, UnparsedObject(crate::datadog::UnparsedObject), } -impl ToString for RumHardcodedRetentionFilterMetaSource { +impl ToString for GlobalOrgType { fn to_string(&self) -> String { match self { - Self::DEFAULT => String::from("default"), - Self::UI => String::from("ui"), - Self::TERRAFORM => String::from("terraform"), + Self::GLOBAL_USER_ORGS => String::from("global_user_orgs"), Self::UnparsedObject(v) => v.value.to_string(), } } } -impl Serialize for RumHardcodedRetentionFilterMetaSource { +impl Serialize for GlobalOrgType { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -36,16 +32,14 @@ impl Serialize for RumHardcodedRetentionFilterMetaSource { } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterMetaSource { +impl<'de> Deserialize<'de> for GlobalOrgType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { let s: String = String::deserialize(deserializer)?; Ok(match s.as_str() { - "default" => Self::DEFAULT, - "ui" => Self::UI, - "terraform" => Self::TERRAFORM, + "global_user_orgs" => Self::GLOBAL_USER_ORGS, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }), diff --git a/src/datadogV2/model/model_global_org_user.rs b/src/datadogV2/model/model_global_org_user.rs new file mode 100644 index 0000000000..1402090975 --- /dev/null +++ b/src/datadogV2/model/model_global_org_user.rs @@ -0,0 +1,102 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// User information for a global organization association. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrgUser { + /// The handle of the user. + #[serde(rename = "handle")] + pub handle: String, + /// The UUID of the user. + #[serde(rename = "uuid")] + pub uuid: uuid::Uuid, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrgUser { + pub fn new(handle: String, uuid: uuid::Uuid) -> GlobalOrgUser { + GlobalOrgUser { + handle, + uuid, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GlobalOrgUser { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgUserVisitor; + impl<'a> Visitor<'a> for GlobalOrgUserVisitor { + type Value = GlobalOrgUser; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut handle: Option = None; + let mut uuid: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "handle" => { + handle = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "uuid" => { + uuid = 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); + } + } + } + } + let handle = handle.ok_or_else(|| M::Error::missing_field("handle"))?; + let uuid = uuid.ok_or_else(|| M::Error::missing_field("uuid"))?; + + let content = GlobalOrgUser { + handle, + uuid, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgUserVisitor) + } +} diff --git a/src/datadogV2/model/model_global_orgs_links.rs b/src/datadogV2/model/model_global_orgs_links.rs new file mode 100644 index 0000000000..5f4657a9c4 --- /dev/null +++ b/src/datadogV2/model/model_global_orgs_links.rs @@ -0,0 +1,133 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Pagination links. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrgsLinks { + /// Link to the next page. + #[serde(rename = "next", default, with = "::serde_with::rust::double_option")] + pub next: Option>, + /// Link to the previous page. + #[serde(rename = "prev", default, with = "::serde_with::rust::double_option")] + pub prev: Option>, + /// Link to the current page. + #[serde(rename = "self")] + pub self_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrgsLinks { + pub fn new() -> GlobalOrgsLinks { + GlobalOrgsLinks { + next: None, + prev: None, + self_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn next(mut self, value: Option) -> Self { + self.next = Some(value); + self + } + + pub fn prev(mut self, value: Option) -> Self { + self.prev = Some(value); + self + } + + pub fn self_(mut self, value: String) -> Self { + self.self_ = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for GlobalOrgsLinks { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GlobalOrgsLinks { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgsLinksVisitor; + impl<'a> Visitor<'a> for GlobalOrgsLinksVisitor { + type Value = GlobalOrgsLinks; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut next: Option> = None; + let mut prev: Option> = None; + let mut self_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "next" => { + next = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "prev" => { + prev = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "self" => { + if v.is_null() { + continue; + } + self_ = 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); + } + } + } + } + + let content = GlobalOrgsLinks { + next, + prev, + self_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgsLinksVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_service_update_attributes.rs b/src/datadogV2/model/model_global_orgs_meta.rs similarity index 66% rename from src/datadogV2/model/model_incident_service_update_attributes.rs rename to src/datadogV2/model/model_global_orgs_meta.rs index c9d94a1bbc..a73c52255a 100644 --- a/src/datadogV2/model/model_incident_service_update_attributes.rs +++ b/src/datadogV2/model/model_global_orgs_meta.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The incident service's attributes for an update request. +/// Response metadata object. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceUpdateAttributes { - /// Name of the incident service. - #[serde(rename = "name")] - pub name: String, +pub struct GlobalOrgsMeta { + /// Paging attributes. + #[serde(rename = "page")] + pub page: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,15 +21,20 @@ pub struct IncidentServiceUpdateAttributes { pub(crate) _unparsed: bool, } -impl IncidentServiceUpdateAttributes { - pub fn new(name: String) -> IncidentServiceUpdateAttributes { - IncidentServiceUpdateAttributes { - name, +impl GlobalOrgsMeta { + pub fn new() -> GlobalOrgsMeta { + GlobalOrgsMeta { + page: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } + pub fn page(mut self, value: crate::datadogV2::model::GlobalOrgsMetaPage) -> Self { + self.page = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -39,14 +44,20 @@ impl IncidentServiceUpdateAttributes { } } -impl<'de> Deserialize<'de> for IncidentServiceUpdateAttributes { +impl Default for GlobalOrgsMeta { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GlobalOrgsMeta { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceUpdateAttributesVisitor; - impl<'a> Visitor<'a> for IncidentServiceUpdateAttributesVisitor { - type Value = IncidentServiceUpdateAttributes; + struct GlobalOrgsMetaVisitor; + impl<'a> Visitor<'a> for GlobalOrgsMetaVisitor { + type Value = GlobalOrgsMeta; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -56,7 +67,7 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateAttributes { where M: MapAccess<'a>, { - let mut name: Option = None; + let mut page: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -65,8 +76,11 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "name" => { - name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + "page" => { + if v.is_null() { + continue; + } + page = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { @@ -75,10 +89,9 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateAttributes { } } } - let name = name.ok_or_else(|| M::Error::missing_field("name"))?; - let content = IncidentServiceUpdateAttributes { - name, + let content = GlobalOrgsMeta { + page, additional_properties, _unparsed, }; @@ -87,6 +100,6 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateAttributes { } } - deserializer.deserialize_any(IncidentServiceUpdateAttributesVisitor) + deserializer.deserialize_any(GlobalOrgsMetaVisitor) } } diff --git a/src/datadogV2/model/model_global_orgs_meta_page.rs b/src/datadogV2/model/model_global_orgs_meta_page.rs new file mode 100644 index 0000000000..b011a7955a --- /dev/null +++ b/src/datadogV2/model/model_global_orgs_meta_page.rs @@ -0,0 +1,185 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Paging attributes. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GlobalOrgsMetaPage { + /// The cursor used to get the current results, if any. + #[serde(rename = "cursor")] + pub cursor: Option, + /// Number of results returned. + #[serde(rename = "limit")] + pub limit: Option, + /// The cursor used to get the next results, if any. + #[serde( + rename = "next_cursor", + default, + with = "::serde_with::rust::double_option" + )] + pub next_cursor: Option>, + /// The cursor used to get the previous results, if any. + #[serde( + rename = "prev_cursor", + default, + with = "::serde_with::rust::double_option" + )] + pub prev_cursor: Option>, + /// Type of global orgs pagination. + #[serde(rename = "type")] + pub type_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GlobalOrgsMetaPage { + pub fn new() -> GlobalOrgsMetaPage { + GlobalOrgsMetaPage { + cursor: None, + limit: None, + next_cursor: None, + prev_cursor: None, + type_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn cursor(mut self, value: String) -> Self { + self.cursor = Some(value); + self + } + + pub fn limit(mut self, value: i32) -> Self { + self.limit = Some(value); + self + } + + pub fn next_cursor(mut self, value: Option) -> Self { + self.next_cursor = Some(value); + self + } + + pub fn prev_cursor(mut self, value: Option) -> Self { + self.prev_cursor = Some(value); + self + } + + pub fn type_(mut self, value: crate::datadogV2::model::GlobalOrgsMetaPageType) -> Self { + self.type_ = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for GlobalOrgsMetaPage { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GlobalOrgsMetaPage { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GlobalOrgsMetaPageVisitor; + impl<'a> Visitor<'a> for GlobalOrgsMetaPageVisitor { + type Value = GlobalOrgsMetaPage; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cursor: Option = None; + let mut limit: Option = None; + let mut next_cursor: Option> = None; + let mut prev_cursor: Option> = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cursor" => { + if v.is_null() { + continue; + } + cursor = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "limit" => { + if v.is_null() { + continue; + } + limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "next_cursor" => { + next_cursor = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "prev_cursor" => { + prev_cursor = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + if v.is_null() { + continue; + } + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::GlobalOrgsMetaPageType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = GlobalOrgsMetaPage { + cursor, + limit, + next_cursor, + prev_cursor, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GlobalOrgsMetaPageVisitor) + } +} diff --git a/src/datadogV2/model/model_global_orgs_meta_page_type.rs b/src/datadogV2/model/model_global_orgs_meta_page_type.rs new file mode 100644 index 0000000000..0c5dee8290 --- /dev/null +++ b/src/datadogV2/model/model_global_orgs_meta_page_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum GlobalOrgsMetaPageType { + CURSOR, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for GlobalOrgsMetaPageType { + fn to_string(&self) -> String { + match self { + Self::CURSOR => String::from("cursor"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for GlobalOrgsMetaPageType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for GlobalOrgsMetaPageType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "cursor" => Self::CURSOR, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_incident_services_response.rs b/src/datadogV2/model/model_global_orgs_response.rs similarity index 63% rename from src/datadogV2/model/model_incident_services_response.rs rename to src/datadogV2/model/model_global_orgs_response.rs index 195a245dd8..488eef1a5b 100644 --- a/src/datadogV2/model/model_incident_services_response.rs +++ b/src/datadogV2/model/model_global_orgs_response.rs @@ -6,20 +6,20 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response with a list of incident service payloads. +/// Response containing organizations across regions for the authenticated user. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServicesResponse { - /// An array of incident services. +pub struct GlobalOrgsResponse { + /// Organizations across regions for the authenticated user. #[serde(rename = "data")] - pub data: Vec, - /// Included related resources which the user requested. - #[serde(rename = "included")] - pub included: Option>, - /// The metadata object containing pagination metadata. + pub data: Vec, + /// Pagination links. + #[serde(rename = "links")] + pub links: Option, + /// Response metadata object. #[serde(rename = "meta")] - pub meta: Option, + pub meta: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -27,28 +27,23 @@ pub struct IncidentServicesResponse { pub(crate) _unparsed: bool, } -impl IncidentServicesResponse { - pub fn new( - data: Vec, - ) -> IncidentServicesResponse { - IncidentServicesResponse { +impl GlobalOrgsResponse { + pub fn new(data: Vec) -> GlobalOrgsResponse { + GlobalOrgsResponse { data, - included: None, + links: None, meta: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn included( - mut self, - value: Vec, - ) -> Self { - self.included = Some(value); + pub fn links(mut self, value: crate::datadogV2::model::GlobalOrgsLinks) -> Self { + self.links = Some(value); self } - pub fn meta(mut self, value: crate::datadogV2::model::IncidentResponseMeta) -> Self { + pub fn meta(mut self, value: crate::datadogV2::model::GlobalOrgsMeta) -> Self { self.meta = Some(value); self } @@ -62,14 +57,14 @@ impl IncidentServicesResponse { } } -impl<'de> Deserialize<'de> for IncidentServicesResponse { +impl<'de> Deserialize<'de> for GlobalOrgsResponse { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServicesResponseVisitor; - impl<'a> Visitor<'a> for IncidentServicesResponseVisitor { - type Value = IncidentServicesResponse; + struct GlobalOrgsResponseVisitor; + impl<'a> Visitor<'a> for GlobalOrgsResponseVisitor { + type Value = GlobalOrgsResponse; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -79,12 +74,9 @@ impl<'de> Deserialize<'de> for IncidentServicesResponse { where M: MapAccess<'a>, { - let mut data: Option> = - None; - let mut included: Option< - Vec, - > = None; - let mut meta: Option = None; + let mut data: Option> = None; + let mut links: Option = None; + let mut meta: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -96,11 +88,11 @@ impl<'de> Deserialize<'de> for IncidentServicesResponse { "data" => { data = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "included" => { + "links" => { if v.is_null() { continue; } - included = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + links = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } "meta" => { if v.is_null() { @@ -117,9 +109,9 @@ impl<'de> Deserialize<'de> for IncidentServicesResponse { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = IncidentServicesResponse { + let content = GlobalOrgsResponse { data, - included, + links, meta, additional_properties, _unparsed, @@ -129,6 +121,6 @@ impl<'de> Deserialize<'de> for IncidentServicesResponse { } } - deserializer.deserialize_any(IncidentServicesResponseVisitor) + deserializer.deserialize_any(GlobalOrgsResponseVisitor) } } diff --git a/src/datadogV2/model/model_incident_service_response_attributes.rs b/src/datadogV2/model/model_google_chat_delegated_user_attributes.rs similarity index 56% rename from src/datadogV2/model/model_incident_service_response_attributes.rs rename to src/datadogV2/model/model_google_chat_delegated_user_attributes.rs index aa309d9fdc..8819e20dbd 100644 --- a/src/datadogV2/model/model_incident_service_response_attributes.rs +++ b/src/datadogV2/model/model_google_chat_delegated_user_attributes.rs @@ -6,20 +6,20 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The incident service's attributes from a response. +/// Google Chat delegated user attributes. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceResponseAttributes { - /// Timestamp of when the incident service was created. - #[serde(rename = "created")] - pub created: Option>, - /// Timestamp of when the incident service was modified. - #[serde(rename = "modified")] - pub modified: Option>, - /// Name of the incident service. - #[serde(rename = "name")] - pub name: Option, +pub struct GoogleChatDelegatedUserAttributes { + /// The delegated user's display name. + #[serde(rename = "display_name")] + pub display_name: Option, + /// The delegated user's email address. + #[serde(rename = "email")] + pub email: Option, + /// The list of features enabled for the delegated user. + #[serde(rename = "features")] + pub features: Option>, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -27,29 +27,29 @@ pub struct IncidentServiceResponseAttributes { pub(crate) _unparsed: bool, } -impl IncidentServiceResponseAttributes { - pub fn new() -> IncidentServiceResponseAttributes { - IncidentServiceResponseAttributes { - created: None, - modified: None, - name: None, +impl GoogleChatDelegatedUserAttributes { + pub fn new() -> GoogleChatDelegatedUserAttributes { + GoogleChatDelegatedUserAttributes { + display_name: None, + email: None, + features: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn created(mut self, value: chrono::DateTime) -> Self { - self.created = Some(value); + pub fn display_name(mut self, value: String) -> Self { + self.display_name = Some(value); self } - pub fn modified(mut self, value: chrono::DateTime) -> Self { - self.modified = Some(value); + pub fn email(mut self, value: String) -> Self { + self.email = Some(value); self } - pub fn name(mut self, value: String) -> Self { - self.name = Some(value); + pub fn features(mut self, value: Vec) -> Self { + self.features = Some(value); self } @@ -62,20 +62,20 @@ impl IncidentServiceResponseAttributes { } } -impl Default for IncidentServiceResponseAttributes { +impl Default for GoogleChatDelegatedUserAttributes { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for IncidentServiceResponseAttributes { +impl<'de> Deserialize<'de> for GoogleChatDelegatedUserAttributes { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceResponseAttributesVisitor; - impl<'a> Visitor<'a> for IncidentServiceResponseAttributesVisitor { - type Value = IncidentServiceResponseAttributes; + struct GoogleChatDelegatedUserAttributesVisitor; + impl<'a> Visitor<'a> for GoogleChatDelegatedUserAttributesVisitor { + type Value = GoogleChatDelegatedUserAttributes; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -85,9 +85,9 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseAttributes { where M: MapAccess<'a>, { - let mut created: Option> = None; - let mut modified: Option> = None; - let mut name: Option = None; + let mut display_name: Option = None; + let mut email: Option = None; + let mut features: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -96,23 +96,24 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "created" => { + "display_name" => { if v.is_null() { continue; } - created = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + display_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "modified" => { + "email" => { if v.is_null() { continue; } - modified = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + email = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "name" => { + "features" => { if v.is_null() { continue; } - name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + features = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { @@ -122,10 +123,10 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseAttributes { } } - let content = IncidentServiceResponseAttributes { - created, - modified, - name, + let content = GoogleChatDelegatedUserAttributes { + display_name, + email, + features, additional_properties, _unparsed, }; @@ -134,6 +135,6 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseAttributes { } } - deserializer.deserialize_any(IncidentServiceResponseAttributesVisitor) + deserializer.deserialize_any(GoogleChatDelegatedUserAttributesVisitor) } } diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_data.rs b/src/datadogV2/model/model_google_chat_delegated_user_data.rs similarity index 63% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_data.rs rename to src/datadogV2/model/model_google_chat_delegated_user_data.rs index 3ccea84d72..b4eab5ce75 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_data.rs +++ b/src/datadogV2/model/model_google_chat_delegated_user_data.rs @@ -6,23 +6,20 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// A hardcoded retention filter. +/// Google Chat delegated user data from a response. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterData { - /// The attributes of a hardcoded retention filter. +pub struct GoogleChatDelegatedUserData { + /// Google Chat delegated user attributes. #[serde(rename = "attributes")] - pub attributes: Option, - /// The ID of the hardcoded retention filter. + pub attributes: Option, + /// The ID of the delegated user. #[serde(rename = "id")] pub id: Option, - /// Metadata about the hardcoded retention filter. - #[serde(rename = "meta")] - pub meta: Option, - /// The resource type. The value must be `hardcoded_retention_filters`. + /// Google Chat delegated user resource type. #[serde(rename = "type")] - pub type_: Option, + pub type_: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -30,12 +27,11 @@ pub struct RumHardcodedRetentionFilterData { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFilterData { - pub fn new() -> RumHardcodedRetentionFilterData { - RumHardcodedRetentionFilterData { +impl GoogleChatDelegatedUserData { + pub fn new() -> GoogleChatDelegatedUserData { + GoogleChatDelegatedUserData { attributes: None, id: None, - meta: None, type_: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -44,7 +40,7 @@ impl RumHardcodedRetentionFilterData { pub fn attributes( mut self, - value: crate::datadogV2::model::RumHardcodedRetentionFilterAttributes, + value: crate::datadogV2::model::GoogleChatDelegatedUserAttributes, ) -> Self { self.attributes = Some(value); self @@ -55,15 +51,7 @@ impl RumHardcodedRetentionFilterData { self } - pub fn meta(mut self, value: crate::datadogV2::model::RumHardcodedRetentionFilterMeta) -> Self { - self.meta = Some(value); - self - } - - pub fn type_( - mut self, - value: crate::datadogV2::model::RumHardcodedRetentionFilterType, - ) -> Self { + pub fn type_(mut self, value: crate::datadogV2::model::GoogleChatDelegatedUserType) -> Self { self.type_ = Some(value); self } @@ -77,20 +65,20 @@ impl RumHardcodedRetentionFilterData { } } -impl Default for RumHardcodedRetentionFilterData { +impl Default for GoogleChatDelegatedUserData { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { +impl<'de> Deserialize<'de> for GoogleChatDelegatedUserData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFilterDataVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterDataVisitor { - type Value = RumHardcodedRetentionFilterData; + struct GoogleChatDelegatedUserDataVisitor; + impl<'a> Visitor<'a> for GoogleChatDelegatedUserDataVisitor { + type Value = GoogleChatDelegatedUserData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -101,13 +89,10 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { M: MapAccess<'a>, { let mut attributes: Option< - crate::datadogV2::model::RumHardcodedRetentionFilterAttributes, + crate::datadogV2::model::GoogleChatDelegatedUserAttributes, > = None; let mut id: Option = None; - let mut meta: Option = - None; - let mut type_: Option = - None; + let mut type_: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -128,12 +113,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { } id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "meta" => { - if v.is_null() { - continue; - } - meta = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } "type" => { if v.is_null() { continue; @@ -141,7 +120,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::RumHardcodedRetentionFilterType::UnparsedObject(_type_) => { + crate::datadogV2::model::GoogleChatDelegatedUserType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -156,10 +135,9 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { } } - let content = RumHardcodedRetentionFilterData { + let content = GoogleChatDelegatedUserData { attributes, id, - meta, type_, additional_properties, _unparsed, @@ -169,6 +147,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterData { } } - deserializer.deserialize_any(RumHardcodedRetentionFilterDataVisitor) + deserializer.deserialize_any(GoogleChatDelegatedUserDataVisitor) } } diff --git a/src/datadogV2/model/model_google_chat_delegated_user_response.rs b/src/datadogV2/model/model_google_chat_delegated_user_response.rs new file mode 100644 index 0000000000..675ac0aa6a --- /dev/null +++ b/src/datadogV2/model/model_google_chat_delegated_user_response.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a Google Chat delegated user. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatDelegatedUserResponse { + /// Google Chat delegated user data from a response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::GoogleChatDelegatedUserData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatDelegatedUserResponse { + pub fn new( + data: crate::datadogV2::model::GoogleChatDelegatedUserData, + ) -> GoogleChatDelegatedUserResponse { + GoogleChatDelegatedUserResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatDelegatedUserResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatDelegatedUserResponseVisitor; + impl<'a> Visitor<'a> for GoogleChatDelegatedUserResponseVisitor { + type Value = GoogleChatDelegatedUserResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatDelegatedUserResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatDelegatedUserResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_delegated_user_type.rs b/src/datadogV2/model/model_google_chat_delegated_user_type.rs new file mode 100644 index 0000000000..7462db4cdc --- /dev/null +++ b/src/datadogV2/model/model_google_chat_delegated_user_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum GoogleChatDelegatedUserType { + GOOGLE_CHAT_DELEGATED_USER_TYPE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for GoogleChatDelegatedUserType { + fn to_string(&self) -> String { + match self { + Self::GOOGLE_CHAT_DELEGATED_USER_TYPE => String::from("google-chat-delegated-user"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for GoogleChatDelegatedUserType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for GoogleChatDelegatedUserType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "google-chat-delegated-user" => Self::GOOGLE_CHAT_DELEGATED_USER_TYPE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_incident_service_relationships.rs b/src/datadogV2/model/model_google_chat_organization_attributes.rs similarity index 59% rename from src/datadogV2/model/model_incident_service_relationships.rs rename to src/datadogV2/model/model_google_chat_organization_attributes.rs index 4fd79b74f1..489aa545aa 100644 --- a/src/datadogV2/model/model_incident_service_relationships.rs +++ b/src/datadogV2/model/model_google_chat_organization_attributes.rs @@ -6,17 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The incident service's relationships. +/// Google Chat organization attributes. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceRelationships { - /// Relationship to user. - #[serde(rename = "created_by")] - pub created_by: Option, - /// Relationship to user. - #[serde(rename = "last_modified_by")] - pub last_modified_by: Option, +pub struct GoogleChatOrganizationAttributes { + /// The Google Chat organization domain ID. + #[serde(rename = "domain_id")] + pub domain_id: Option, + /// The Google Chat organization domain name. + #[serde(rename = "domain_name")] + pub domain_name: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -24,23 +24,23 @@ pub struct IncidentServiceRelationships { pub(crate) _unparsed: bool, } -impl IncidentServiceRelationships { - pub fn new() -> IncidentServiceRelationships { - IncidentServiceRelationships { - created_by: None, - last_modified_by: None, +impl GoogleChatOrganizationAttributes { + pub fn new() -> GoogleChatOrganizationAttributes { + GoogleChatOrganizationAttributes { + domain_id: None, + domain_name: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn created_by(mut self, value: crate::datadogV2::model::RelationshipToUser) -> Self { - self.created_by = Some(value); + pub fn domain_id(mut self, value: String) -> Self { + self.domain_id = Some(value); self } - pub fn last_modified_by(mut self, value: crate::datadogV2::model::RelationshipToUser) -> Self { - self.last_modified_by = Some(value); + pub fn domain_name(mut self, value: String) -> Self { + self.domain_name = Some(value); self } @@ -53,20 +53,20 @@ impl IncidentServiceRelationships { } } -impl Default for IncidentServiceRelationships { +impl Default for GoogleChatOrganizationAttributes { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for IncidentServiceRelationships { +impl<'de> Deserialize<'de> for GoogleChatOrganizationAttributes { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceRelationshipsVisitor; - impl<'a> Visitor<'a> for IncidentServiceRelationshipsVisitor { - type Value = IncidentServiceRelationships; + struct GoogleChatOrganizationAttributesVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationAttributesVisitor { + type Value = GoogleChatOrganizationAttributes; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -76,9 +76,8 @@ impl<'de> Deserialize<'de> for IncidentServiceRelationships { where M: MapAccess<'a>, { - let mut created_by: Option = None; - let mut last_modified_by: Option = - None; + let mut domain_id: Option = None; + let mut domain_name: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -87,17 +86,17 @@ impl<'de> Deserialize<'de> for IncidentServiceRelationships { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "created_by" => { + "domain_id" => { if v.is_null() { continue; } - created_by = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + domain_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "last_modified_by" => { + "domain_name" => { if v.is_null() { continue; } - last_modified_by = + domain_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { @@ -108,9 +107,9 @@ impl<'de> Deserialize<'de> for IncidentServiceRelationships { } } - let content = IncidentServiceRelationships { - created_by, - last_modified_by, + let content = GoogleChatOrganizationAttributes { + domain_id, + domain_name, additional_properties, _unparsed, }; @@ -119,6 +118,6 @@ impl<'de> Deserialize<'de> for IncidentServiceRelationships { } } - deserializer.deserialize_any(IncidentServiceRelationshipsVisitor) + deserializer.deserialize_any(GoogleChatOrganizationAttributesVisitor) } } diff --git a/src/datadogV2/model/model_incident_service_update_data.rs b/src/datadogV2/model/model_google_chat_organization_data.rs similarity index 69% rename from src/datadogV2/model/model_incident_service_update_data.rs rename to src/datadogV2/model/model_google_chat_organization_data.rs index a2800d74eb..a36eb7c12c 100644 --- a/src/datadogV2/model/model_incident_service_update_data.rs +++ b/src/datadogV2/model/model_google_chat_organization_data.rs @@ -6,23 +6,23 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Incident Service payload for update requests. +/// Google Chat organization data from a response. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceUpdateData { - /// The incident service's attributes for an update request. +pub struct GoogleChatOrganizationData { + /// Google Chat organization attributes. #[serde(rename = "attributes")] - pub attributes: Option, - /// The incident service's ID. + pub attributes: Option, + /// The ID of the Google Chat organization binding. #[serde(rename = "id")] pub id: Option, - /// The incident service's relationships. + /// Google Chat organization relationships. #[serde(rename = "relationships")] - pub relationships: Option, - /// Incident service resource type. + pub relationships: Option, + /// Google Chat organization resource type. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::IncidentServiceType, + pub type_: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -30,13 +30,13 @@ pub struct IncidentServiceUpdateData { pub(crate) _unparsed: bool, } -impl IncidentServiceUpdateData { - pub fn new(type_: crate::datadogV2::model::IncidentServiceType) -> IncidentServiceUpdateData { - IncidentServiceUpdateData { +impl GoogleChatOrganizationData { + pub fn new() -> GoogleChatOrganizationData { + GoogleChatOrganizationData { attributes: None, id: None, relationships: None, - type_, + type_: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -44,7 +44,7 @@ impl IncidentServiceUpdateData { pub fn attributes( mut self, - value: crate::datadogV2::model::IncidentServiceUpdateAttributes, + value: crate::datadogV2::model::GoogleChatOrganizationAttributes, ) -> Self { self.attributes = Some(value); self @@ -57,12 +57,17 @@ impl IncidentServiceUpdateData { pub fn relationships( mut self, - value: crate::datadogV2::model::IncidentServiceRelationships, + value: crate::datadogV2::model::GoogleChatOrganizationRelationships, ) -> Self { self.relationships = Some(value); self } + pub fn type_(mut self, value: crate::datadogV2::model::GoogleChatOrganizationType) -> Self { + self.type_ = Some(value); + self + } + pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -72,14 +77,20 @@ impl IncidentServiceUpdateData { } } -impl<'de> Deserialize<'de> for IncidentServiceUpdateData { +impl Default for GoogleChatOrganizationData { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GoogleChatOrganizationData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceUpdateDataVisitor; - impl<'a> Visitor<'a> for IncidentServiceUpdateDataVisitor { - type Value = IncidentServiceUpdateData; + struct GoogleChatOrganizationDataVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationDataVisitor { + type Value = GoogleChatOrganizationData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -90,13 +101,13 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateData { M: MapAccess<'a>, { let mut attributes: Option< - crate::datadogV2::model::IncidentServiceUpdateAttributes, + crate::datadogV2::model::GoogleChatOrganizationAttributes, > = None; let mut id: Option = None; let mut relationships: Option< - crate::datadogV2::model::IncidentServiceRelationships, + crate::datadogV2::model::GoogleChatOrganizationRelationships, > = None; - let mut type_: Option = None; + let mut type_: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -125,10 +136,13 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateData { Some(serde_json::from_value(v).map_err(M::Error::custom)?); } "type" => { + if v.is_null() { + continue; + } type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::IncidentServiceType::UnparsedObject(_type_) => { + crate::datadogV2::model::GoogleChatOrganizationType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -142,9 +156,8 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateData { } } } - let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; - let content = IncidentServiceUpdateData { + let content = GoogleChatOrganizationData { attributes, id, relationships, @@ -157,6 +170,6 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateData { } } - deserializer.deserialize_any(IncidentServiceUpdateDataVisitor) + deserializer.deserialize_any(GoogleChatOrganizationDataVisitor) } } diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_attributes.rs b/src/datadogV2/model/model_google_chat_organization_relationships.rs similarity index 58% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_update_attributes.rs rename to src/datadogV2/model/model_google_chat_organization_relationships.rs index 2d9593c792..1c3da81708 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_attributes.rs +++ b/src/datadogV2/model/model_google_chat_organization_relationships.rs @@ -6,17 +6,15 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The attributes of a hardcoded retention filter that can be updated. -/// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. +/// Google Chat organization relationships. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterUpdateAttributes { - /// Partial update for cross-product retention of a hardcoded retention filter. - /// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. - #[serde(rename = "cross_product_sampling")] - pub cross_product_sampling: - Option, +pub struct GoogleChatOrganizationRelationships { + /// The delegated user relationship. + #[serde(rename = "delegated_user")] + pub delegated_user: + Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -24,20 +22,20 @@ pub struct RumHardcodedRetentionFilterUpdateAttributes { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFilterUpdateAttributes { - pub fn new() -> RumHardcodedRetentionFilterUpdateAttributes { - RumHardcodedRetentionFilterUpdateAttributes { - cross_product_sampling: None, +impl GoogleChatOrganizationRelationships { + pub fn new() -> GoogleChatOrganizationRelationships { + GoogleChatOrganizationRelationships { + delegated_user: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn cross_product_sampling( + pub fn delegated_user( mut self, - value: crate::datadogV2::model::RumHardcodedCrossProductSamplingUpdate, + value: crate::datadogV2::model::GoogleChatOrganizationRelationshipsDelegatedUser, ) -> Self { - self.cross_product_sampling = Some(value); + self.delegated_user = Some(value); self } @@ -50,20 +48,20 @@ impl RumHardcodedRetentionFilterUpdateAttributes { } } -impl Default for RumHardcodedRetentionFilterUpdateAttributes { +impl Default for GoogleChatOrganizationRelationships { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateAttributes { +impl<'de> Deserialize<'de> for GoogleChatOrganizationRelationships { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFilterUpdateAttributesVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterUpdateAttributesVisitor { - type Value = RumHardcodedRetentionFilterUpdateAttributes; + struct GoogleChatOrganizationRelationshipsVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationRelationshipsVisitor { + type Value = GoogleChatOrganizationRelationships; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -73,8 +71,8 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateAttributes { where M: MapAccess<'a>, { - let mut cross_product_sampling: Option< - crate::datadogV2::model::RumHardcodedCrossProductSamplingUpdate, + let mut delegated_user: Option< + crate::datadogV2::model::GoogleChatOrganizationRelationshipsDelegatedUser, > = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -84,11 +82,11 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "cross_product_sampling" => { + "delegated_user" => { if v.is_null() { continue; } - cross_product_sampling = + delegated_user = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { @@ -99,8 +97,8 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateAttributes { } } - let content = RumHardcodedRetentionFilterUpdateAttributes { - cross_product_sampling, + let content = GoogleChatOrganizationRelationships { + delegated_user, additional_properties, _unparsed, }; @@ -109,6 +107,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateAttributes { } } - deserializer.deserialize_any(RumHardcodedRetentionFilterUpdateAttributesVisitor) + deserializer.deserialize_any(GoogleChatOrganizationRelationshipsVisitor) } } diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filters_response.rs b/src/datadogV2/model/model_google_chat_organization_relationships_delegated_user.rs similarity index 70% rename from src/datadogV2/model/model_rum_hardcoded_retention_filters_response.rs rename to src/datadogV2/model/model_google_chat_organization_relationships_delegated_user.rs index 121f3639ff..97d93baf09 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filters_response.rs +++ b/src/datadogV2/model/model_google_chat_organization_relationships_delegated_user.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// All hardcoded retention filters for a RUM application. +/// The delegated user relationship. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFiltersResponse { - /// A list of hardcoded retention filters. +pub struct GoogleChatOrganizationRelationshipsDelegatedUser { + /// Delegated user relationship data. #[serde(rename = "data")] - pub data: Option>, + pub data: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,9 +21,9 @@ pub struct RumHardcodedRetentionFiltersResponse { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFiltersResponse { - pub fn new() -> RumHardcodedRetentionFiltersResponse { - RumHardcodedRetentionFiltersResponse { +impl GoogleChatOrganizationRelationshipsDelegatedUser { + pub fn new() -> GoogleChatOrganizationRelationshipsDelegatedUser { + GoogleChatOrganizationRelationshipsDelegatedUser { data: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -32,7 +32,7 @@ impl RumHardcodedRetentionFiltersResponse { pub fn data( mut self, - value: Vec, + value: crate::datadogV2::model::GoogleChatOrganizationRelationshipsDelegatedUserData, ) -> Self { self.data = Some(value); self @@ -47,20 +47,20 @@ impl RumHardcodedRetentionFiltersResponse { } } -impl Default for RumHardcodedRetentionFiltersResponse { +impl Default for GoogleChatOrganizationRelationshipsDelegatedUser { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFiltersResponse { +impl<'de> Deserialize<'de> for GoogleChatOrganizationRelationshipsDelegatedUser { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFiltersResponseVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFiltersResponseVisitor { - type Value = RumHardcodedRetentionFiltersResponse; + struct GoogleChatOrganizationRelationshipsDelegatedUserVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationRelationshipsDelegatedUserVisitor { + type Value = GoogleChatOrganizationRelationshipsDelegatedUser; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -71,7 +71,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFiltersResponse { M: MapAccess<'a>, { let mut data: Option< - Vec, + crate::datadogV2::model::GoogleChatOrganizationRelationshipsDelegatedUserData, > = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -95,7 +95,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFiltersResponse { } } - let content = RumHardcodedRetentionFiltersResponse { + let content = GoogleChatOrganizationRelationshipsDelegatedUser { data, additional_properties, _unparsed, @@ -105,6 +105,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFiltersResponse { } } - deserializer.deserialize_any(RumHardcodedRetentionFiltersResponseVisitor) + deserializer.deserialize_any(GoogleChatOrganizationRelationshipsDelegatedUserVisitor) } } diff --git a/src/datadogV2/model/model_google_chat_organization_relationships_delegated_user_data.rs b/src/datadogV2/model/model_google_chat_organization_relationships_delegated_user_data.rs new file mode 100644 index 0000000000..de92459028 --- /dev/null +++ b/src/datadogV2/model/model_google_chat_organization_relationships_delegated_user_data.rs @@ -0,0 +1,130 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Delegated user relationship data. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatOrganizationRelationshipsDelegatedUserData { + /// The ID of the delegated user. + #[serde(rename = "id")] + pub id: Option, + /// Google Chat delegated user resource type. + #[serde(rename = "type")] + pub type_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatOrganizationRelationshipsDelegatedUserData { + pub fn new() -> GoogleChatOrganizationRelationshipsDelegatedUserData { + GoogleChatOrganizationRelationshipsDelegatedUserData { + id: None, + type_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_(mut self, value: crate::datadogV2::model::GoogleChatDelegatedUserType) -> Self { + self.type_ = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for GoogleChatOrganizationRelationshipsDelegatedUserData { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GoogleChatOrganizationRelationshipsDelegatedUserData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatOrganizationRelationshipsDelegatedUserDataVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationRelationshipsDelegatedUserDataVisitor { + type Value = GoogleChatOrganizationRelationshipsDelegatedUserData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "id" => { + if v.is_null() { + continue; + } + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + if v.is_null() { + continue; + } + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::GoogleChatDelegatedUserType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = GoogleChatOrganizationRelationshipsDelegatedUserData { + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatOrganizationRelationshipsDelegatedUserDataVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_organization_response.rs b/src/datadogV2/model/model_google_chat_organization_response.rs new file mode 100644 index 0000000000..5a377af17b --- /dev/null +++ b/src/datadogV2/model/model_google_chat_organization_response.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a Google Chat organization binding. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatOrganizationResponse { + /// Google Chat organization data from a response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::GoogleChatOrganizationData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatOrganizationResponse { + pub fn new( + data: crate::datadogV2::model::GoogleChatOrganizationData, + ) -> GoogleChatOrganizationResponse { + GoogleChatOrganizationResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatOrganizationResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatOrganizationResponseVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationResponseVisitor { + type Value = GoogleChatOrganizationResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatOrganizationResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatOrganizationResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_organization_type.rs b/src/datadogV2/model/model_google_chat_organization_type.rs new file mode 100644 index 0000000000..1b30e58a98 --- /dev/null +++ b/src/datadogV2/model/model_google_chat_organization_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum GoogleChatOrganizationType { + GOOGLE_CHAT_ORGANIZATION_TYPE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for GoogleChatOrganizationType { + fn to_string(&self) -> String { + match self { + Self::GOOGLE_CHAT_ORGANIZATION_TYPE => String::from("google-chat-organization"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for GoogleChatOrganizationType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for GoogleChatOrganizationType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "google-chat-organization" => Self::GOOGLE_CHAT_ORGANIZATION_TYPE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_google_chat_organizations_response.rs b/src/datadogV2/model/model_google_chat_organizations_response.rs new file mode 100644 index 0000000000..bb0ef9137c --- /dev/null +++ b/src/datadogV2/model/model_google_chat_organizations_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a list of Google Chat organization bindings. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatOrganizationsResponse { + /// An array of Google Chat organization bindings. + #[serde(rename = "data")] + pub data: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatOrganizationsResponse { + pub fn new( + data: Vec, + ) -> GoogleChatOrganizationsResponse { + GoogleChatOrganizationsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatOrganizationsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatOrganizationsResponseVisitor; + impl<'a> Visitor<'a> for GoogleChatOrganizationsResponseVisitor { + type Value = GoogleChatOrganizationsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option> = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatOrganizationsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatOrganizationsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_target_audience_attributes.rs b/src/datadogV2/model/model_google_chat_target_audience_attributes.rs new file mode 100644 index 0000000000..0fd765c82a --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_attributes.rs @@ -0,0 +1,106 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Google Chat target audience attributes. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceAttributes { + /// The audience ID. + #[serde(rename = "audience_id")] + pub audience_id: String, + /// The audience name. + #[serde(rename = "audience_name")] + pub audience_name: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceAttributes { + pub fn new(audience_id: String, audience_name: String) -> GoogleChatTargetAudienceAttributes { + GoogleChatTargetAudienceAttributes { + audience_id, + audience_name, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceAttributesVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceAttributesVisitor { + type Value = GoogleChatTargetAudienceAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut audience_id: Option = None; + let mut audience_name: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "audience_id" => { + audience_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "audience_name" => { + audience_name = + 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); + } + } + } + } + let audience_id = + audience_id.ok_or_else(|| M::Error::missing_field("audience_id"))?; + let audience_name = + audience_name.ok_or_else(|| M::Error::missing_field("audience_name"))?; + + let content = GoogleChatTargetAudienceAttributes { + audience_id, + audience_name, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_request.rs b/src/datadogV2/model/model_google_chat_target_audience_create_request.rs similarity index 72% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_update_request.rs rename to src/datadogV2/model/model_google_chat_target_audience_create_request.rs index 4811045ccb..e3a4d64049 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_request.rs +++ b/src/datadogV2/model/model_google_chat_target_audience_create_request.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The hardcoded retention filter body to update. +/// Create target audience request. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterUpdateRequest { - /// The hardcoded retention filter properties to update. +pub struct GoogleChatTargetAudienceCreateRequest { + /// Data for a create target audience request. #[serde(rename = "data")] - pub data: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateData, + pub data: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestData, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,11 +21,11 @@ pub struct RumHardcodedRetentionFilterUpdateRequest { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFilterUpdateRequest { +impl GoogleChatTargetAudienceCreateRequest { pub fn new( - data: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateData, - ) -> RumHardcodedRetentionFilterUpdateRequest { - RumHardcodedRetentionFilterUpdateRequest { + data: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestData, + ) -> GoogleChatTargetAudienceCreateRequest { + GoogleChatTargetAudienceCreateRequest { data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -41,14 +41,14 @@ impl RumHardcodedRetentionFilterUpdateRequest { } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateRequest { +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceCreateRequest { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFilterUpdateRequestVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterUpdateRequestVisitor { - type Value = RumHardcodedRetentionFilterUpdateRequest; + struct GoogleChatTargetAudienceCreateRequestVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceCreateRequestVisitor { + type Value = GoogleChatTargetAudienceCreateRequest; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -59,7 +59,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateRequest { M: MapAccess<'a>, { let mut data: Option< - crate::datadogV2::model::RumHardcodedRetentionFilterUpdateData, + crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestData, > = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -81,7 +81,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateRequest { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = RumHardcodedRetentionFilterUpdateRequest { + let content = GoogleChatTargetAudienceCreateRequest { data, additional_properties, _unparsed, @@ -91,6 +91,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateRequest { } } - deserializer.deserialize_any(RumHardcodedRetentionFilterUpdateRequestVisitor) + deserializer.deserialize_any(GoogleChatTargetAudienceCreateRequestVisitor) } } diff --git a/src/datadogV2/model/model_google_chat_target_audience_create_request_attributes.rs b/src/datadogV2/model/model_google_chat_target_audience_create_request_attributes.rs new file mode 100644 index 0000000000..d3f4e7320d --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_create_request_attributes.rs @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes for creating a Google Chat target audience. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceCreateRequestAttributes { + /// The audience ID. + #[serde(rename = "audience_id")] + pub audience_id: String, + /// The audience name. + #[serde(rename = "audience_name")] + pub audience_name: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceCreateRequestAttributes { + pub fn new( + audience_id: String, + audience_name: String, + ) -> GoogleChatTargetAudienceCreateRequestAttributes { + GoogleChatTargetAudienceCreateRequestAttributes { + audience_id, + audience_name, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceCreateRequestAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceCreateRequestAttributesVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceCreateRequestAttributesVisitor { + type Value = GoogleChatTargetAudienceCreateRequestAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut audience_id: Option = None; + let mut audience_name: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "audience_id" => { + audience_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "audience_name" => { + audience_name = + 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); + } + } + } + } + let audience_id = + audience_id.ok_or_else(|| M::Error::missing_field("audience_id"))?; + let audience_name = + audience_name.ok_or_else(|| M::Error::missing_field("audience_name"))?; + + let content = GoogleChatTargetAudienceCreateRequestAttributes { + audience_id, + audience_name, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceCreateRequestAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_target_audience_create_request_data.rs b/src/datadogV2/model/model_google_chat_target_audience_create_request_data.rs new file mode 100644 index 0000000000..2761f6c51a --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_create_request_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data for a create target audience request. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceCreateRequestData { + /// Attributes for creating a Google Chat target audience. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestAttributes, + /// Google Chat target audience resource type. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::GoogleChatTargetAudienceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceCreateRequestData { + pub fn new( + attributes: crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestAttributes, + type_: crate::datadogV2::model::GoogleChatTargetAudienceType, + ) -> GoogleChatTargetAudienceCreateRequestData { + GoogleChatTargetAudienceCreateRequestData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceCreateRequestData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceCreateRequestDataVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceCreateRequestDataVisitor { + type Value = GoogleChatTargetAudienceCreateRequestData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::GoogleChatTargetAudienceCreateRequestAttributes, + > = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::GoogleChatTargetAudienceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = GoogleChatTargetAudienceCreateRequestData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceCreateRequestDataVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_service_create_data.rs b/src/datadogV2/model/model_google_chat_target_audience_data.rs similarity index 62% rename from src/datadogV2/model/model_incident_service_create_data.rs rename to src/datadogV2/model/model_google_chat_target_audience_data.rs index 93c2b23678..3ef2ccac5c 100644 --- a/src/datadogV2/model/model_incident_service_create_data.rs +++ b/src/datadogV2/model/model_google_chat_target_audience_data.rs @@ -6,20 +6,20 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Incident Service payload for create requests. +/// Google Chat target audience data from a response. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceCreateData { - /// The incident service's attributes for a create request. +pub struct GoogleChatTargetAudienceData { + /// Google Chat target audience attributes. #[serde(rename = "attributes")] - pub attributes: Option, - /// The incident service's relationships. - #[serde(rename = "relationships")] - pub relationships: Option, - /// Incident service resource type. + pub attributes: Option, + /// The ID of the target audience. + #[serde(rename = "id")] + pub id: Option, + /// Google Chat target audience resource type. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::IncidentServiceType, + pub type_: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -27,12 +27,12 @@ pub struct IncidentServiceCreateData { pub(crate) _unparsed: bool, } -impl IncidentServiceCreateData { - pub fn new(type_: crate::datadogV2::model::IncidentServiceType) -> IncidentServiceCreateData { - IncidentServiceCreateData { +impl GoogleChatTargetAudienceData { + pub fn new() -> GoogleChatTargetAudienceData { + GoogleChatTargetAudienceData { attributes: None, - relationships: None, - type_, + id: None, + type_: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -40,17 +40,19 @@ impl IncidentServiceCreateData { pub fn attributes( mut self, - value: crate::datadogV2::model::IncidentServiceCreateAttributes, + value: crate::datadogV2::model::GoogleChatTargetAudienceAttributes, ) -> Self { self.attributes = Some(value); self } - pub fn relationships( - mut self, - value: crate::datadogV2::model::IncidentServiceRelationships, - ) -> Self { - self.relationships = Some(value); + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_(mut self, value: crate::datadogV2::model::GoogleChatTargetAudienceType) -> Self { + self.type_ = Some(value); self } @@ -63,14 +65,20 @@ impl IncidentServiceCreateData { } } -impl<'de> Deserialize<'de> for IncidentServiceCreateData { +impl Default for GoogleChatTargetAudienceData { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceCreateDataVisitor; - impl<'a> Visitor<'a> for IncidentServiceCreateDataVisitor { - type Value = IncidentServiceCreateData; + struct GoogleChatTargetAudienceDataVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceDataVisitor { + type Value = GoogleChatTargetAudienceData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -81,12 +89,10 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateData { M: MapAccess<'a>, { let mut attributes: Option< - crate::datadogV2::model::IncidentServiceCreateAttributes, - > = None; - let mut relationships: Option< - crate::datadogV2::model::IncidentServiceRelationships, + crate::datadogV2::model::GoogleChatTargetAudienceAttributes, > = None; - let mut type_: Option = None; + let mut id: Option = None; + let mut type_: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -101,18 +107,20 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateData { } attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "relationships" => { + "id" => { if v.is_null() { continue; } - relationships = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } "type" => { + if v.is_null() { + continue; + } type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::IncidentServiceType::UnparsedObject(_type_) => { + crate::datadogV2::model::GoogleChatTargetAudienceType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -126,11 +134,10 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateData { } } } - let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; - let content = IncidentServiceCreateData { + let content = GoogleChatTargetAudienceData { attributes, - relationships, + id, type_, additional_properties, _unparsed, @@ -140,6 +147,6 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateData { } } - deserializer.deserialize_any(IncidentServiceCreateDataVisitor) + deserializer.deserialize_any(GoogleChatTargetAudienceDataVisitor) } } diff --git a/src/datadogV2/model/model_google_chat_target_audience_response.rs b/src/datadogV2/model/model_google_chat_target_audience_response.rs new file mode 100644 index 0000000000..02d97bd521 --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_response.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a Google Chat target audience. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceResponse { + /// Google Chat target audience data from a response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::GoogleChatTargetAudienceData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceResponse { + pub fn new( + data: crate::datadogV2::model::GoogleChatTargetAudienceData, + ) -> GoogleChatTargetAudienceResponse { + GoogleChatTargetAudienceResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceResponseVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceResponseVisitor { + type Value = GoogleChatTargetAudienceResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatTargetAudienceResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_target_audience_type.rs b/src/datadogV2/model/model_google_chat_target_audience_type.rs new file mode 100644 index 0000000000..3ccd61a781 --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum GoogleChatTargetAudienceType { + GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for GoogleChatTargetAudienceType { + fn to_string(&self) -> String { + match self { + Self::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE => String::from("google-chat-target-audience"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for GoogleChatTargetAudienceType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "google-chat-target-audience" => Self::GOOGLE_CHAT_TARGET_AUDIENCE_TYPE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_google_chat_target_audience_update_request.rs b/src/datadogV2/model/model_google_chat_target_audience_update_request.rs new file mode 100644 index 0000000000..7a57edb32b --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_update_request.rs @@ -0,0 +1,96 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Update target audience request. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceUpdateRequest { + /// Data for an update target audience request. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceUpdateRequest { + pub fn new( + data: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestData, + ) -> GoogleChatTargetAudienceUpdateRequest { + GoogleChatTargetAudienceUpdateRequest { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceUpdateRequest { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceUpdateRequestVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceUpdateRequestVisitor { + type Value = GoogleChatTargetAudienceUpdateRequest; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option< + crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestData, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatTargetAudienceUpdateRequest { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceUpdateRequestVisitor) + } +} diff --git a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_editability.rs b/src/datadogV2/model/model_google_chat_target_audience_update_request_attributes.rs similarity index 58% rename from src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_editability.rs rename to src/datadogV2/model/model_google_chat_target_audience_update_request_attributes.rs index 83f1112791..74c2217737 100644 --- a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_editability.rs +++ b/src/datadogV2/model/model_google_chat_target_audience_update_request_attributes.rs @@ -6,17 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Flags indicating which `cross_product_sampling` fields can be updated. Read-only. +/// Attributes for updating a Google Chat target audience. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedCrossProductSamplingEditability { - /// If `true`, `cross_product_sampling.session_replay_sample_rate` can be updated on this filter. - #[serde(rename = "session_replay_sample_rate")] - pub session_replay_sample_rate: Option, - /// If `true`, `cross_product_sampling.trace_sample_rate` can be updated on this filter. - #[serde(rename = "trace_sample_rate")] - pub trace_sample_rate: Option, +pub struct GoogleChatTargetAudienceUpdateRequestAttributes { + /// The audience ID. + #[serde(rename = "audience_id")] + pub audience_id: Option, + /// The audience name. + #[serde(rename = "audience_name")] + pub audience_name: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -24,23 +24,23 @@ pub struct RumHardcodedCrossProductSamplingEditability { pub(crate) _unparsed: bool, } -impl RumHardcodedCrossProductSamplingEditability { - pub fn new() -> RumHardcodedCrossProductSamplingEditability { - RumHardcodedCrossProductSamplingEditability { - session_replay_sample_rate: None, - trace_sample_rate: None, +impl GoogleChatTargetAudienceUpdateRequestAttributes { + pub fn new() -> GoogleChatTargetAudienceUpdateRequestAttributes { + GoogleChatTargetAudienceUpdateRequestAttributes { + audience_id: None, + audience_name: None, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn session_replay_sample_rate(mut self, value: bool) -> Self { - self.session_replay_sample_rate = Some(value); + pub fn audience_id(mut self, value: String) -> Self { + self.audience_id = Some(value); self } - pub fn trace_sample_rate(mut self, value: bool) -> Self { - self.trace_sample_rate = Some(value); + pub fn audience_name(mut self, value: String) -> Self { + self.audience_name = Some(value); self } @@ -53,20 +53,20 @@ impl RumHardcodedCrossProductSamplingEditability { } } -impl Default for RumHardcodedCrossProductSamplingEditability { +impl Default for GoogleChatTargetAudienceUpdateRequestAttributes { fn default() -> Self { Self::new() } } -impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingEditability { +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceUpdateRequestAttributes { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedCrossProductSamplingEditabilityVisitor; - impl<'a> Visitor<'a> for RumHardcodedCrossProductSamplingEditabilityVisitor { - type Value = RumHardcodedCrossProductSamplingEditability; + struct GoogleChatTargetAudienceUpdateRequestAttributesVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceUpdateRequestAttributesVisitor { + type Value = GoogleChatTargetAudienceUpdateRequestAttributes; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -76,8 +76,8 @@ impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingEditability { where M: MapAccess<'a>, { - let mut session_replay_sample_rate: Option = None; - let mut trace_sample_rate: Option = None; + let mut audience_id: Option = None; + let mut audience_name: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -86,18 +86,18 @@ impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingEditability { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "session_replay_sample_rate" => { + "audience_id" => { if v.is_null() { continue; } - session_replay_sample_rate = + audience_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } - "trace_sample_rate" => { + "audience_name" => { if v.is_null() { continue; } - trace_sample_rate = + audience_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { @@ -108,9 +108,9 @@ impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingEditability { } } - let content = RumHardcodedCrossProductSamplingEditability { - session_replay_sample_rate, - trace_sample_rate, + let content = GoogleChatTargetAudienceUpdateRequestAttributes { + audience_id, + audience_name, additional_properties, _unparsed, }; @@ -119,6 +119,6 @@ impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingEditability { } } - deserializer.deserialize_any(RumHardcodedCrossProductSamplingEditabilityVisitor) + deserializer.deserialize_any(GoogleChatTargetAudienceUpdateRequestAttributesVisitor) } } diff --git a/src/datadogV2/model/model_google_chat_target_audience_update_request_data.rs b/src/datadogV2/model/model_google_chat_target_audience_update_request_data.rs new file mode 100644 index 0000000000..271106a162 --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audience_update_request_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data for an update target audience request. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudienceUpdateRequestData { + /// Attributes for updating a Google Chat target audience. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestAttributes, + /// Google Chat target audience resource type. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::GoogleChatTargetAudienceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudienceUpdateRequestData { + pub fn new( + attributes: crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestAttributes, + type_: crate::datadogV2::model::GoogleChatTargetAudienceType, + ) -> GoogleChatTargetAudienceUpdateRequestData { + GoogleChatTargetAudienceUpdateRequestData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudienceUpdateRequestData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudienceUpdateRequestDataVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudienceUpdateRequestDataVisitor { + type Value = GoogleChatTargetAudienceUpdateRequestData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::GoogleChatTargetAudienceUpdateRequestAttributes, + > = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::GoogleChatTargetAudienceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = GoogleChatTargetAudienceUpdateRequestData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudienceUpdateRequestDataVisitor) + } +} diff --git a/src/datadogV2/model/model_google_chat_target_audiences_response.rs b/src/datadogV2/model/model_google_chat_target_audiences_response.rs new file mode 100644 index 0000000000..1b5737694a --- /dev/null +++ b/src/datadogV2/model/model_google_chat_target_audiences_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a list of Google Chat target audiences. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct GoogleChatTargetAudiencesResponse { + /// An array of Google Chat target audiences. + #[serde(rename = "data")] + pub data: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl GoogleChatTargetAudiencesResponse { + pub fn new( + data: Vec, + ) -> GoogleChatTargetAudiencesResponse { + GoogleChatTargetAudiencesResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for GoogleChatTargetAudiencesResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct GoogleChatTargetAudiencesResponseVisitor; + impl<'a> Visitor<'a> for GoogleChatTargetAudiencesResponseVisitor { + type Value = GoogleChatTargetAudiencesResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option> = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = GoogleChatTargetAudiencesResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(GoogleChatTargetAudiencesResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_service_included_items.rs b/src/datadogV2/model/model_incident_service_included_items.rs deleted file mode 100644 index 0fdfc94c97..0000000000 --- a/src/datadogV2/model/model_incident_service_included_items.rs +++ /dev/null @@ -1,32 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::{Deserialize, Deserializer, Serialize}; - -/// An object related to an incident service which is present in the included payload. -#[non_exhaustive] -#[derive(Clone, Debug, PartialEq, Serialize)] -#[serde(untagged)] -pub enum IncidentServiceIncludedItems { - User(Box), - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl<'de> Deserialize<'de> for IncidentServiceIncludedItems { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let value: serde_json::Value = Deserialize::deserialize(deserializer)?; - if let Ok(_v) = serde_json::from_value::>(value.clone()) - { - if !_v._unparsed { - return Ok(IncidentServiceIncludedItems::User(_v)); - } - } - - return Ok(IncidentServiceIncludedItems::UnparsedObject( - crate::datadog::UnparsedObject { value }, - )); - } -} diff --git a/src/datadogV2/model/model_llm_obs_patterns_activity_progress.rs b/src/datadogV2/model/model_llm_obs_patterns_activity_progress.rs new file mode 100644 index 0000000000..b07691c245 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_activity_progress.rs @@ -0,0 +1,120 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Progress information for a single step of a patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsActivityProgress { + /// Name of the step. + #[serde(rename = "name")] + pub name: String, + /// Timestamp when the step started. Null if the step has not started. + #[serde( + rename = "started_at", + default, + with = "::serde_with::rust::double_option" + )] + pub started_at: Option>>, + /// Status of the step. + #[serde(rename = "status")] + pub status: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsActivityProgress { + pub fn new(name: String, status: String) -> LLMObsPatternsActivityProgress { + LLMObsPatternsActivityProgress { + name, + started_at: None, + status, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn started_at(mut self, value: Option>) -> Self { + self.started_at = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsActivityProgress { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsActivityProgressVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsActivityProgressVisitor { + type Value = LLMObsPatternsActivityProgress; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut name: Option = None; + let mut started_at: Option>> = None; + let mut status: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "started_at" => { + started_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + status = 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); + } + } + } + } + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; + + let content = LLMObsPatternsActivityProgress { + name, + started_at, + status, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsActivityProgressVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_clustered_point.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_point.rs new file mode 100644 index 0000000000..e5cff0f3ff --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_point.rs @@ -0,0 +1,175 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A single data point grouped into a topic. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsClusteredPoint { + /// Identifier of the source event. + #[serde(rename = "event_id")] + pub event_id: String, + /// Unique identifier of the clustered point. + #[serde(rename = "id")] + pub id: String, + /// Input text of the source span. + #[serde(rename = "input")] + pub input: String, + /// Whether the point is included in the patterns dataset. + #[serde(rename = "is_included")] + pub is_included: bool, + /// Whether the point is suggested for inclusion in the patterns dataset. + #[serde(rename = "is_suggested")] + pub is_suggested: bool, + /// Identifier of the source session. + #[serde(rename = "session_id")] + pub session_id: String, + /// Identifier of the source span. + #[serde(rename = "span_id")] + pub span_id: String, + /// Identifier of the topic the point belongs to. + #[serde(rename = "topic_id")] + pub topic_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsClusteredPoint { + pub fn new( + event_id: String, + id: String, + input: String, + is_included: bool, + is_suggested: bool, + session_id: String, + span_id: String, + topic_id: String, + ) -> LLMObsPatternsClusteredPoint { + LLMObsPatternsClusteredPoint { + event_id, + id, + input, + is_included, + is_suggested, + session_id, + span_id, + topic_id, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPoint { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsClusteredPointVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsClusteredPointVisitor { + type Value = LLMObsPatternsClusteredPoint; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut event_id: Option = None; + let mut id: Option = None; + let mut input: Option = None; + let mut is_included: Option = None; + let mut is_suggested: Option = None; + let mut session_id: Option = None; + let mut span_id: Option = None; + let mut topic_id: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "event_id" => { + event_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "input" => { + input = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "is_included" => { + is_included = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "is_suggested" => { + is_suggested = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "session_id" => { + session_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "span_id" => { + span_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "topic_id" => { + topic_id = 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); + } + } + } + } + let event_id = event_id.ok_or_else(|| M::Error::missing_field("event_id"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let input = input.ok_or_else(|| M::Error::missing_field("input"))?; + let is_included = + is_included.ok_or_else(|| M::Error::missing_field("is_included"))?; + let is_suggested = + is_suggested.ok_or_else(|| M::Error::missing_field("is_suggested"))?; + let session_id = session_id.ok_or_else(|| M::Error::missing_field("session_id"))?; + let span_id = span_id.ok_or_else(|| M::Error::missing_field("span_id"))?; + let topic_id = topic_id.ok_or_else(|| M::Error::missing_field("topic_id"))?; + + let content = LLMObsPatternsClusteredPoint { + event_id, + id, + input, + is_included, + is_suggested, + session_id, + span_id, + topic_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsClusteredPointVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_clustered_point_ref.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_point_ref.rs new file mode 100644 index 0000000000..6ba12f35f7 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_point_ref.rs @@ -0,0 +1,221 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A clustered point attached inline to a topic. The metric fields are populated +/// only when the request includes `include_metrics=true`. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsClusteredPointRef { + /// Duration of the source span in nanoseconds. Included only when metrics are requested. + #[serde(rename = "duration")] + pub duration: Option, + /// Estimated total cost of the source span. Included only when metrics are requested. + #[serde(rename = "estimated_total_cost")] + pub estimated_total_cost: Option, + /// Evaluation results for the source span keyed by evaluation name. Included + /// only when metrics are requested. + #[serde(rename = "evaluation")] + pub evaluation: Option>, + /// Number of input tokens of the source span. Included only when metrics are requested. + #[serde(rename = "input_tokens")] + pub input_tokens: Option, + /// Number of output tokens of the source span. Included only when metrics are requested. + #[serde(rename = "output_tokens")] + pub output_tokens: Option, + /// Identifier of the source span. + #[serde(rename = "span_id")] + pub span_id: String, + /// Status of the source span. Included only when metrics are requested. + #[serde(rename = "status")] + pub status: Option, + /// Total number of tokens of the source span. Included only when metrics are requested. + #[serde(rename = "total_tokens")] + pub total_tokens: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsClusteredPointRef { + pub fn new(span_id: String) -> LLMObsPatternsClusteredPointRef { + LLMObsPatternsClusteredPointRef { + duration: None, + estimated_total_cost: None, + evaluation: None, + input_tokens: None, + output_tokens: None, + span_id, + status: None, + total_tokens: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn duration(mut self, value: f64) -> Self { + self.duration = Some(value); + self + } + + pub fn estimated_total_cost(mut self, value: f64) -> Self { + self.estimated_total_cost = Some(value); + self + } + + pub fn evaluation( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.evaluation = Some(value); + self + } + + pub fn input_tokens(mut self, value: f64) -> Self { + self.input_tokens = Some(value); + self + } + + pub fn output_tokens(mut self, value: f64) -> Self { + self.output_tokens = Some(value); + self + } + + pub fn status(mut self, value: String) -> Self { + self.status = Some(value); + self + } + + pub fn total_tokens(mut self, value: f64) -> Self { + self.total_tokens = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPointRef { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsClusteredPointRefVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsClusteredPointRefVisitor { + type Value = LLMObsPatternsClusteredPointRef; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut duration: Option = None; + let mut estimated_total_cost: Option = None; + let mut evaluation: Option> = + None; + let mut input_tokens: Option = None; + let mut output_tokens: Option = None; + let mut span_id: Option = None; + let mut status: Option = None; + let mut total_tokens: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "duration" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + duration = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "estimated_total_cost" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + estimated_total_cost = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "evaluation" => { + if v.is_null() { + continue; + } + evaluation = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "input_tokens" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + input_tokens = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "output_tokens" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + output_tokens = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "span_id" => { + span_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + if v.is_null() { + continue; + } + status = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "total_tokens" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + total_tokens = + 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); + } + } + } + } + let span_id = span_id.ok_or_else(|| M::Error::missing_field("span_id"))?; + + let content = LLMObsPatternsClusteredPointRef { + duration, + estimated_total_cost, + evaluation, + input_tokens, + output_tokens, + span_id, + status, + total_tokens, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsClusteredPointRefVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response.rs new file mode 100644 index 0000000000..4aa49053ff --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response.rs @@ -0,0 +1,96 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing the clustered points of an LLM Observability topic. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsClusteredPointsResponse { + /// Data object of an LLM Observability patterns clustered points response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsClusteredPointsResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseData, + ) -> LLMObsPatternsClusteredPointsResponse { + LLMObsPatternsClusteredPointsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPointsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsClusteredPointsResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsClusteredPointsResponseVisitor { + type Value = LLMObsPatternsClusteredPointsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option< + crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseData, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsClusteredPointsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsClusteredPointsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_attributes.rs new file mode 100644 index 0000000000..9cd37aebf1 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_attributes.rs @@ -0,0 +1,120 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns clustered points response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsClusteredPointsResponseAttributes { + /// Pagination token for the next page of points. Null if there are no more pages. + #[serialize_always] + #[serde(rename = "next_page_token")] + pub next_page_token: Option, + /// List of clustered points. + #[serde(rename = "points")] + pub points: Vec, + /// Identifier of the topic the points belong to. + #[serde(rename = "topic_id")] + pub topic_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsClusteredPointsResponseAttributes { + pub fn new( + next_page_token: Option, + points: Vec, + topic_id: String, + ) -> LLMObsPatternsClusteredPointsResponseAttributes { + LLMObsPatternsClusteredPointsResponseAttributes { + next_page_token, + points, + topic_id, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPointsResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsClusteredPointsResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsClusteredPointsResponseAttributesVisitor { + type Value = LLMObsPatternsClusteredPointsResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut next_page_token: Option> = None; + let mut points: Option> = + None; + let mut topic_id: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "next_page_token" => { + next_page_token = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "points" => { + points = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "topic_id" => { + topic_id = 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); + } + } + } + } + let next_page_token = + next_page_token.ok_or_else(|| M::Error::missing_field("next_page_token"))?; + let points = points.ok_or_else(|| M::Error::missing_field("points"))?; + let topic_id = topic_id.ok_or_else(|| M::Error::missing_field("topic_id"))?; + + let content = LLMObsPatternsClusteredPointsResponseAttributes { + next_page_token, + points, + topic_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsClusteredPointsResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_data.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_data.rs similarity index 68% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_update_data.rs rename to src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_data.rs index a2f95cab98..1e2f1e1bb5 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_update_data.rs +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_response_data.rs @@ -6,21 +6,20 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The hardcoded retention filter properties to update. +/// Data object of an LLM Observability patterns clustered points response. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterUpdateData { - /// The attributes of a hardcoded retention filter that can be updated. - /// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be modified. +pub struct LLMObsPatternsClusteredPointsResponseData { + /// Attributes of an LLM Observability patterns clustered points response. #[serde(rename = "attributes")] - pub attributes: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateAttributes, - /// The ID of the hardcoded retention filter. Must match the `rf_id` path parameter. + pub attributes: crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseAttributes, + /// Identifier of the topic the points belong to. #[serde(rename = "id")] pub id: String, - /// The resource type. The value must be `hardcoded_retention_filters`. + /// Resource type of an LLM Observability patterns clustered points response. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::RumHardcodedRetentionFilterType, + pub type_: crate::datadogV2::model::LLMObsPatternsClusteredPointsType, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -28,13 +27,13 @@ pub struct RumHardcodedRetentionFilterUpdateData { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFilterUpdateData { +impl LLMObsPatternsClusteredPointsResponseData { pub fn new( - attributes: crate::datadogV2::model::RumHardcodedRetentionFilterUpdateAttributes, + attributes: crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseAttributes, id: String, - type_: crate::datadogV2::model::RumHardcodedRetentionFilterType, - ) -> RumHardcodedRetentionFilterUpdateData { - RumHardcodedRetentionFilterUpdateData { + type_: crate::datadogV2::model::LLMObsPatternsClusteredPointsType, + ) -> LLMObsPatternsClusteredPointsResponseData { + LLMObsPatternsClusteredPointsResponseData { attributes, id, type_, @@ -52,14 +51,14 @@ impl RumHardcodedRetentionFilterUpdateData { } } -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateData { +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPointsResponseData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFilterUpdateDataVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterUpdateDataVisitor { - type Value = RumHardcodedRetentionFilterUpdateData; + struct LLMObsPatternsClusteredPointsResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsClusteredPointsResponseDataVisitor { + type Value = LLMObsPatternsClusteredPointsResponseData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -70,10 +69,10 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateData { M: MapAccess<'a>, { let mut attributes: Option< - crate::datadogV2::model::RumHardcodedRetentionFilterUpdateAttributes, + crate::datadogV2::model::LLMObsPatternsClusteredPointsResponseAttributes, > = None; let mut id: Option = None; - let mut type_: Option = + let mut type_: Option = None; let mut additional_properties: std::collections::BTreeMap< String, @@ -93,7 +92,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateData { type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::RumHardcodedRetentionFilterType::UnparsedObject(_type_) => { + crate::datadogV2::model::LLMObsPatternsClusteredPointsType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -111,7 +110,7 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateData { let id = id.ok_or_else(|| M::Error::missing_field("id"))?; let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; - let content = RumHardcodedRetentionFilterUpdateData { + let content = LLMObsPatternsClusteredPointsResponseData { attributes, id, type_, @@ -123,6 +122,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterUpdateData { } } - deserializer.deserialize_any(RumHardcodedRetentionFilterUpdateDataVisitor) + deserializer.deserialize_any(LLMObsPatternsClusteredPointsResponseDataVisitor) } } diff --git a/src/datadogV2/model/model_llm_obs_patterns_clustered_points_type.rs b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_type.rs new file mode 100644 index 0000000000..a2f3994183 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_clustered_points_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsClusteredPointsType { + CLUSTERED_POINTS_RESPONSE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsClusteredPointsType { + fn to_string(&self) -> String { + match self { + Self::CLUSTERED_POINTS_RESPONSE => String::from("clustered_points_response"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsClusteredPointsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsClusteredPointsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "clustered_points_response" => Self::CLUSTERED_POINTS_RESPONSE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_config_attributes.rs new file mode 100644 index 0000000000..1098d87d35 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_attributes.rs @@ -0,0 +1,250 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigAttributes { + /// Integration account ID for a bring-your-own-model configuration. + #[serde( + rename = "account_id", + default, + with = "::serde_with::rust::double_option" + )] + pub account_id: Option>, + /// Timestamp when the configuration was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Query that selects the spans the patterns run analyzes. + #[serde(rename = "evp_query")] + pub evp_query: String, + /// Depth of the topic hierarchy to generate. + #[serde(rename = "hierarchy_depth")] + pub hierarchy_depth: i32, + /// Integration provider for a bring-your-own-model configuration. + #[serde( + rename = "integration_provider", + default, + with = "::serde_with::rust::double_option" + )] + pub integration_provider: Option>, + /// Model name for a bring-your-own-model configuration. + #[serde( + rename = "model_name", + default, + with = "::serde_with::rust::double_option" + )] + pub model_name: Option>, + /// Name of the configuration. + #[serde(rename = "name")] + pub name: String, + /// Maximum number of records to process for the run. + #[serde(rename = "num_records")] + pub num_records: i32, + /// Fraction of matching spans to sample for the run. + #[serde(rename = "sampling_ratio")] + pub sampling_ratio: f64, + /// Scope of the configuration. + #[serde(rename = "scope")] + pub scope: String, + /// Template used to guide topic generation. + #[serde( + rename = "template", + default, + with = "::serde_with::rust::double_option" + )] + pub template: Option>, + /// Timestamp when the configuration was last updated. + #[serde(rename = "updated_at")] + pub updated_at: chrono::DateTime, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigAttributes { + pub fn new( + created_at: chrono::DateTime, + evp_query: String, + hierarchy_depth: i32, + name: String, + num_records: i32, + sampling_ratio: f64, + scope: String, + updated_at: chrono::DateTime, + ) -> LLMObsPatternsConfigAttributes { + LLMObsPatternsConfigAttributes { + account_id: None, + created_at, + evp_query, + hierarchy_depth, + integration_provider: None, + model_name: None, + name, + num_records, + sampling_ratio, + scope, + template: None, + updated_at, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn account_id(mut self, value: Option) -> Self { + self.account_id = Some(value); + self + } + + pub fn integration_provider(mut self, value: Option) -> Self { + self.integration_provider = Some(value); + self + } + + pub fn model_name(mut self, value: Option) -> Self { + self.model_name = Some(value); + self + } + + pub fn template(mut self, value: Option) -> Self { + self.template = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigAttributesVisitor { + type Value = LLMObsPatternsConfigAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut account_id: Option> = None; + let mut created_at: Option> = None; + let mut evp_query: Option = None; + let mut hierarchy_depth: Option = None; + let mut integration_provider: Option> = None; + let mut model_name: Option> = None; + let mut name: Option = None; + let mut num_records: Option = None; + let mut sampling_ratio: Option = None; + let mut scope: Option = None; + let mut template: Option> = None; + let mut updated_at: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "account_id" => { + account_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "evp_query" => { + evp_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_depth" => { + hierarchy_depth = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "integration_provider" => { + integration_provider = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "model_name" => { + model_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "num_records" => { + num_records = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "sampling_ratio" => { + sampling_ratio = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "template" => { + template = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "updated_at" => { + updated_at = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let evp_query = evp_query.ok_or_else(|| M::Error::missing_field("evp_query"))?; + let hierarchy_depth = + hierarchy_depth.ok_or_else(|| M::Error::missing_field("hierarchy_depth"))?; + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let num_records = + num_records.ok_or_else(|| M::Error::missing_field("num_records"))?; + let sampling_ratio = + sampling_ratio.ok_or_else(|| M::Error::missing_field("sampling_ratio"))?; + let scope = scope.ok_or_else(|| M::Error::missing_field("scope"))?; + let updated_at = updated_at.ok_or_else(|| M::Error::missing_field("updated_at"))?; + + let content = LLMObsPatternsConfigAttributes { + account_id, + created_at, + evp_query, + hierarchy_depth, + integration_provider, + model_name, + name, + num_records, + sampling_ratio, + scope, + template, + updated_at, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_item.rs b/src/datadogV2/model/model_llm_obs_patterns_config_item.rs new file mode 100644 index 0000000000..b8e42ce469 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_item.rs @@ -0,0 +1,261 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A single LLM Observability patterns configuration in a list response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigItem { + /// Integration account ID for a bring-your-own-model configuration. + #[serde( + rename = "account_id", + default, + with = "::serde_with::rust::double_option" + )] + pub account_id: Option>, + /// Timestamp when the configuration was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Query that selects the spans the patterns run analyzes. + #[serde(rename = "evp_query")] + pub evp_query: String, + /// Depth of the topic hierarchy to generate. + #[serde(rename = "hierarchy_depth")] + pub hierarchy_depth: i32, + /// Unique identifier of the configuration. + #[serde(rename = "id")] + pub id: String, + /// Integration provider for a bring-your-own-model configuration. + #[serde( + rename = "integration_provider", + default, + with = "::serde_with::rust::double_option" + )] + pub integration_provider: Option>, + /// Model name for a bring-your-own-model configuration. + #[serde( + rename = "model_name", + default, + with = "::serde_with::rust::double_option" + )] + pub model_name: Option>, + /// Name of the configuration. + #[serde(rename = "name")] + pub name: String, + /// Maximum number of records to process for the run. + #[serde(rename = "num_records")] + pub num_records: i32, + /// Fraction of matching spans to sample for the run. + #[serde(rename = "sampling_ratio")] + pub sampling_ratio: f64, + /// Scope of the configuration. + #[serde(rename = "scope")] + pub scope: String, + /// Template used to guide topic generation. + #[serde( + rename = "template", + default, + with = "::serde_with::rust::double_option" + )] + pub template: Option>, + /// Timestamp when the configuration was last updated. + #[serde(rename = "updated_at")] + pub updated_at: chrono::DateTime, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigItem { + pub fn new( + created_at: chrono::DateTime, + evp_query: String, + hierarchy_depth: i32, + id: String, + name: String, + num_records: i32, + sampling_ratio: f64, + scope: String, + updated_at: chrono::DateTime, + ) -> LLMObsPatternsConfigItem { + LLMObsPatternsConfigItem { + account_id: None, + created_at, + evp_query, + hierarchy_depth, + id, + integration_provider: None, + model_name: None, + name, + num_records, + sampling_ratio, + scope, + template: None, + updated_at, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn account_id(mut self, value: Option) -> Self { + self.account_id = Some(value); + self + } + + pub fn integration_provider(mut self, value: Option) -> Self { + self.integration_provider = Some(value); + self + } + + pub fn model_name(mut self, value: Option) -> Self { + self.model_name = Some(value); + self + } + + pub fn template(mut self, value: Option) -> Self { + self.template = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigItem { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigItemVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigItemVisitor { + type Value = LLMObsPatternsConfigItem; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut account_id: Option> = None; + let mut created_at: Option> = None; + let mut evp_query: Option = None; + let mut hierarchy_depth: Option = None; + let mut id: Option = None; + let mut integration_provider: Option> = None; + let mut model_name: Option> = None; + let mut name: Option = None; + let mut num_records: Option = None; + let mut sampling_ratio: Option = None; + let mut scope: Option = None; + let mut template: Option> = None; + let mut updated_at: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "account_id" => { + account_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "evp_query" => { + evp_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_depth" => { + hierarchy_depth = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "integration_provider" => { + integration_provider = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "model_name" => { + model_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "num_records" => { + num_records = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "sampling_ratio" => { + sampling_ratio = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "template" => { + template = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "updated_at" => { + updated_at = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let evp_query = evp_query.ok_or_else(|| M::Error::missing_field("evp_query"))?; + let hierarchy_depth = + hierarchy_depth.ok_or_else(|| M::Error::missing_field("hierarchy_depth"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let num_records = + num_records.ok_or_else(|| M::Error::missing_field("num_records"))?; + let sampling_ratio = + sampling_ratio.ok_or_else(|| M::Error::missing_field("sampling_ratio"))?; + let scope = scope.ok_or_else(|| M::Error::missing_field("scope"))?; + let updated_at = updated_at.ok_or_else(|| M::Error::missing_field("updated_at"))?; + + let content = LLMObsPatternsConfigItem { + account_id, + created_at, + evp_query, + hierarchy_depth, + id, + integration_provider, + model_name, + name, + num_records, + sampling_ratio, + scope, + template, + updated_at, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigItemVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_response.rs b/src/datadogV2/model/model_llm_obs_patterns_config_response.rs new file mode 100644 index 0000000000..8546269f3e --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a single LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigResponse { + /// Data object of an LLM Observability patterns configuration. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsConfigResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsConfigResponseData, + ) -> LLMObsPatternsConfigResponse { + LLMObsPatternsConfigResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigResponseVisitor { + type Value = LLMObsPatternsConfigResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsConfigResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_config_response_data.rs new file mode 100644 index 0000000000..0138ede8ee --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_response_data.rs @@ -0,0 +1,126 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigResponseData { + /// Attributes of an LLM Observability patterns configuration. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsConfigAttributes, + /// Unique identifier of the configuration. + #[serde(rename = "id")] + pub id: String, + /// Resource type of an LLM Observability patterns configuration. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsConfigType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsConfigAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsConfigType, + ) -> LLMObsPatternsConfigResponseData { + LLMObsPatternsConfigResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigResponseDataVisitor { + type Value = LLMObsPatternsConfigResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsConfigAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsConfigType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsConfigResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_snapshot.rs b/src/datadogV2/model/model_llm_obs_patterns_config_snapshot.rs new file mode 100644 index 0000000000..f1a6a85b39 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_snapshot.rs @@ -0,0 +1,211 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Snapshot of the configuration used for a patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigSnapshot { + /// Integration account ID used for a bring-your-own-model run. + #[serde(rename = "account_id")] + pub account_id: Option, + /// Query that selected the spans for the run. + #[serde(rename = "evp_query")] + pub evp_query: Option, + /// Depth of the topic hierarchy generated. + #[serde(rename = "hierarchy_depth")] + pub hierarchy_depth: Option, + /// Integration provider used for a bring-your-own-model run. + #[serde(rename = "integration_provider")] + pub integration_provider: Option, + /// Model name used for a bring-your-own-model run. + #[serde(rename = "model_name")] + pub model_name: Option, + /// Maximum number of records processed for the run. + #[serde(rename = "num_records")] + pub num_records: Option, + /// Fraction of matching spans sampled for the run. + #[serde(rename = "sampling_ratio")] + pub sampling_ratio: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigSnapshot { + pub fn new() -> LLMObsPatternsConfigSnapshot { + LLMObsPatternsConfigSnapshot { + account_id: None, + evp_query: None, + hierarchy_depth: None, + integration_provider: None, + model_name: None, + num_records: None, + sampling_ratio: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn account_id(mut self, value: String) -> Self { + self.account_id = Some(value); + self + } + + pub fn evp_query(mut self, value: String) -> Self { + self.evp_query = Some(value); + self + } + + pub fn hierarchy_depth(mut self, value: i32) -> Self { + self.hierarchy_depth = Some(value); + self + } + + pub fn integration_provider(mut self, value: String) -> Self { + self.integration_provider = Some(value); + self + } + + pub fn model_name(mut self, value: String) -> Self { + self.model_name = Some(value); + self + } + + pub fn num_records(mut self, value: i32) -> Self { + self.num_records = Some(value); + self + } + + pub fn sampling_ratio(mut self, value: f64) -> Self { + self.sampling_ratio = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for LLMObsPatternsConfigSnapshot { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigSnapshot { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigSnapshotVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigSnapshotVisitor { + type Value = LLMObsPatternsConfigSnapshot; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut account_id: Option = None; + let mut evp_query: Option = None; + let mut hierarchy_depth: Option = None; + let mut integration_provider: Option = None; + let mut model_name: Option = None; + let mut num_records: Option = None; + let mut sampling_ratio: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "account_id" => { + if v.is_null() { + continue; + } + account_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "evp_query" => { + if v.is_null() { + continue; + } + evp_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_depth" => { + if v.is_null() { + continue; + } + hierarchy_depth = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "integration_provider" => { + if v.is_null() { + continue; + } + integration_provider = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "model_name" => { + if v.is_null() { + continue; + } + model_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "num_records" => { + if v.is_null() { + continue; + } + num_records = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "sampling_ratio" => { + if v.is_null() || v.as_str() == Some("") { + continue; + } + sampling_ratio = + 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); + } + } + } + } + + let content = LLMObsPatternsConfigSnapshot { + account_id, + evp_query, + hierarchy_depth, + integration_provider, + model_name, + num_records, + sampling_ratio, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigSnapshotVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_type.rs b/src/datadogV2/model/model_llm_obs_patterns_config_type.rs new file mode 100644 index 0000000000..1c5e1cec7f --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsConfigType { + TOPIC_DISCOVERY_CONFIGS, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsConfigType { + fn to_string(&self) -> String { + match self { + Self::TOPIC_DISCOVERY_CONFIGS => String::from("topic_discovery_configs"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsConfigType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "topic_discovery_configs" => Self::TOPIC_DISCOVERY_CONFIGS, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request.rs b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request.rs new file mode 100644 index 0000000000..c9f3792f87 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request.rs @@ -0,0 +1,96 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Request to create or update an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigUpsertRequest { + /// Data object for creating or updating an LLM Observability patterns configuration. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigUpsertRequest { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestData, + ) -> LLMObsPatternsConfigUpsertRequest { + LLMObsPatternsConfigUpsertRequest { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigUpsertRequest { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigUpsertRequestVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigUpsertRequestVisitor { + type Value = LLMObsPatternsConfigUpsertRequest; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option< + crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestData, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsConfigUpsertRequest { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigUpsertRequestVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_attributes.rs new file mode 100644 index 0000000000..8082361600 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_attributes.rs @@ -0,0 +1,247 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes for creating or updating an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigUpsertRequestAttributes { + /// Integration account ID for a bring-your-own-model configuration. + #[serde(rename = "account_id")] + pub account_id: Option, + /// The ID of an existing configuration to update. If omitted, a new configuration is created. + #[serde(rename = "config_id")] + pub config_id: Option, + /// Query that selects the spans the patterns run analyzes. + #[serde(rename = "evp_query")] + pub evp_query: String, + /// Depth of the topic hierarchy to generate. + #[serde(rename = "hierarchy_depth")] + pub hierarchy_depth: i32, + /// Integration provider for a bring-your-own-model configuration. + #[serde(rename = "integration_provider")] + pub integration_provider: Option, + /// Model name for a bring-your-own-model configuration. + #[serde(rename = "model_name")] + pub model_name: Option, + /// Name of the configuration. + #[serde(rename = "name")] + pub name: String, + /// Maximum number of records to process for the run. + #[serde(rename = "num_records")] + pub num_records: i32, + /// Fraction of matching spans to sample for the run. + #[serde(rename = "sampling_ratio")] + pub sampling_ratio: f64, + /// Scope of the configuration. + #[serde(rename = "scope")] + pub scope: Option, + /// Template used to guide topic generation. + #[serde(rename = "template")] + pub template: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigUpsertRequestAttributes { + pub fn new( + evp_query: String, + hierarchy_depth: i32, + name: String, + num_records: i32, + sampling_ratio: f64, + ) -> LLMObsPatternsConfigUpsertRequestAttributes { + LLMObsPatternsConfigUpsertRequestAttributes { + account_id: None, + config_id: None, + evp_query, + hierarchy_depth, + integration_provider: None, + model_name: None, + name, + num_records, + sampling_ratio, + scope: None, + template: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn account_id(mut self, value: String) -> Self { + self.account_id = Some(value); + self + } + + pub fn config_id(mut self, value: String) -> Self { + self.config_id = Some(value); + self + } + + pub fn integration_provider(mut self, value: String) -> Self { + self.integration_provider = Some(value); + self + } + + pub fn model_name(mut self, value: String) -> Self { + self.model_name = Some(value); + self + } + + pub fn scope(mut self, value: String) -> Self { + self.scope = Some(value); + self + } + + pub fn template(mut self, value: String) -> Self { + self.template = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigUpsertRequestAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigUpsertRequestAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigUpsertRequestAttributesVisitor { + type Value = LLMObsPatternsConfigUpsertRequestAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut account_id: Option = None; + let mut config_id: Option = None; + let mut evp_query: Option = None; + let mut hierarchy_depth: Option = None; + let mut integration_provider: Option = None; + let mut model_name: Option = None; + let mut name: Option = None; + let mut num_records: Option = None; + let mut sampling_ratio: Option = None; + let mut scope: Option = None; + let mut template: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "account_id" => { + if v.is_null() { + continue; + } + account_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_id" => { + if v.is_null() { + continue; + } + config_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "evp_query" => { + evp_query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_depth" => { + hierarchy_depth = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "integration_provider" => { + if v.is_null() { + continue; + } + integration_provider = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "model_name" => { + if v.is_null() { + continue; + } + model_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "num_records" => { + num_records = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "sampling_ratio" => { + sampling_ratio = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + if v.is_null() { + continue; + } + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "template" => { + if v.is_null() { + continue; + } + template = 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); + } + } + } + } + let evp_query = evp_query.ok_or_else(|| M::Error::missing_field("evp_query"))?; + let hierarchy_depth = + hierarchy_depth.ok_or_else(|| M::Error::missing_field("hierarchy_depth"))?; + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let num_records = + num_records.ok_or_else(|| M::Error::missing_field("num_records"))?; + let sampling_ratio = + sampling_ratio.ok_or_else(|| M::Error::missing_field("sampling_ratio"))?; + + let content = LLMObsPatternsConfigUpsertRequestAttributes { + account_id, + config_id, + evp_query, + hierarchy_depth, + integration_provider, + model_name, + name, + num_records, + sampling_ratio, + scope, + template, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigUpsertRequestAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_data.rs b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_data.rs new file mode 100644 index 0000000000..e7b830efdf --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_config_upsert_request_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object for creating or updating an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigUpsertRequestData { + /// Attributes for creating or updating an LLM Observability patterns configuration. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestAttributes, + /// Resource type of an LLM Observability patterns configuration. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsConfigType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigUpsertRequestData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestAttributes, + type_: crate::datadogV2::model::LLMObsPatternsConfigType, + ) -> LLMObsPatternsConfigUpsertRequestData { + LLMObsPatternsConfigUpsertRequestData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigUpsertRequestData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigUpsertRequestDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigUpsertRequestDataVisitor { + type Value = LLMObsPatternsConfigUpsertRequestData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsConfigUpsertRequestAttributes, + > = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsConfigType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsConfigUpsertRequestData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigUpsertRequestDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_configs_list_type.rs b/src/datadogV2/model/model_llm_obs_patterns_configs_list_type.rs new file mode 100644 index 0000000000..11e61bc4b0 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_configs_list_type.rs @@ -0,0 +1,50 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsConfigsListType { + LIST_TOPIC_DISCOVERY_CONFIGS_RESPONSE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsConfigsListType { + fn to_string(&self) -> String { + match self { + Self::LIST_TOPIC_DISCOVERY_CONFIGS_RESPONSE => { + String::from("list_topic_discovery_configs_response") + } + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsConfigsListType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigsListType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "list_topic_discovery_configs_response" => Self::LIST_TOPIC_DISCOVERY_CONFIGS_RESPONSE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_configs_response.rs b/src/datadogV2/model/model_llm_obs_patterns_configs_response.rs new file mode 100644 index 0000000000..492c1a1a63 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_configs_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing a list of LLM Observability patterns configurations. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigsResponse { + /// Data object of a list of LLM Observability patterns configurations. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsConfigsResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigsResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsConfigsResponseData, + ) -> LLMObsPatternsConfigsResponse { + LLMObsPatternsConfigsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigsResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigsResponseVisitor { + type Value = LLMObsPatternsConfigsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsConfigsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_configs_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_configs_response_attributes.rs new file mode 100644 index 0000000000..72e092a96a --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_configs_response_attributes.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of a list of LLM Observability patterns configurations. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigsResponseAttributes { + /// List of patterns configurations. + #[serde(rename = "configs")] + pub configs: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigsResponseAttributes { + pub fn new( + configs: Vec, + ) -> LLMObsPatternsConfigsResponseAttributes { + LLMObsPatternsConfigsResponseAttributes { + configs, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigsResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigsResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigsResponseAttributesVisitor { + type Value = LLMObsPatternsConfigsResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut configs: Option> = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "configs" => { + configs = 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); + } + } + } + } + let configs = configs.ok_or_else(|| M::Error::missing_field("configs"))?; + + let content = LLMObsPatternsConfigsResponseAttributes { + configs, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigsResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_configs_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_configs_response_data.rs new file mode 100644 index 0000000000..e42036ef2d --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_configs_response_data.rs @@ -0,0 +1,127 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of a list of LLM Observability patterns configurations. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsConfigsResponseData { + /// Attributes of a list of LLM Observability patterns configurations. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsConfigsResponseAttributes, + /// Identifier of the list response. + #[serde(rename = "id")] + pub id: String, + /// Resource type of a list of LLM Observability patterns configurations. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsConfigsListType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsConfigsResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsConfigsResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsConfigsListType, + ) -> LLMObsPatternsConfigsResponseData { + LLMObsPatternsConfigsResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsConfigsResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsConfigsResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsConfigsResponseDataVisitor { + type Value = LLMObsPatternsConfigsResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsConfigsResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsConfigsListType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsConfigsResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsConfigsResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_request_type.rs b/src/datadogV2/model/model_llm_obs_patterns_request_type.rs new file mode 100644 index 0000000000..ca1ae63d31 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_request_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsRequestType { + TOPIC_DISCOVERY, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsRequestType { + fn to_string(&self) -> String { + match self { + Self::TOPIC_DISCOVERY => String::from("topic_discovery"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsRequestType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRequestType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "topic_discovery" => Self::TOPIC_DISCOVERY, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_run_status_response.rs b/src/datadogV2/model/model_llm_obs_patterns_run_status_response.rs new file mode 100644 index 0000000000..4b2f984635 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_run_status_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing the status of an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunStatusResponse { + /// Data object of an LLM Observability patterns run status response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsRunStatusResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunStatusResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsRunStatusResponseData, + ) -> LLMObsPatternsRunStatusResponse { + LLMObsPatternsRunStatusResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunStatusResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunStatusResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunStatusResponseVisitor { + type Value = LLMObsPatternsRunStatusResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsRunStatusResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunStatusResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_run_status_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_run_status_response_attributes.rs new file mode 100644 index 0000000000..8a84ced814 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_run_status_response_attributes.rs @@ -0,0 +1,129 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns run status. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunStatusResponseAttributes { + /// Timestamp when the run was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// List of step-by-step progress entries for a patterns run. + #[serde(rename = "progress")] + pub progress: Vec, + /// Overall status of the run. + #[serde(rename = "status")] + pub status: String, + /// The current step of the run. + #[serde(rename = "step")] + pub step: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunStatusResponseAttributes { + pub fn new( + created_at: chrono::DateTime, + progress: Vec, + status: String, + step: String, + ) -> LLMObsPatternsRunStatusResponseAttributes { + LLMObsPatternsRunStatusResponseAttributes { + created_at, + progress, + status, + step, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunStatusResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunStatusResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunStatusResponseAttributesVisitor { + type Value = LLMObsPatternsRunStatusResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut created_at: Option> = None; + let mut progress: Option< + Vec, + > = None; + let mut status: Option = None; + let mut step: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "progress" => { + progress = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + status = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "step" => { + step = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let progress = progress.ok_or_else(|| M::Error::missing_field("progress"))?; + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; + let step = step.ok_or_else(|| M::Error::missing_field("step"))?; + + let content = LLMObsPatternsRunStatusResponseAttributes { + created_at, + progress, + status, + step, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunStatusResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_run_status_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_run_status_response_data.rs new file mode 100644 index 0000000000..b20edefd29 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_run_status_response_data.rs @@ -0,0 +1,126 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns run status response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunStatusResponseData { + /// Attributes of an LLM Observability patterns run status. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsRunStatusResponseAttributes, + /// The ID of the patterns run. + #[serde(rename = "id")] + pub id: String, + /// Resource type of an LLM Observability patterns run status. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsRunStatusType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunStatusResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsRunStatusResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsRunStatusType, + ) -> LLMObsPatternsRunStatusResponseData { + LLMObsPatternsRunStatusResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunStatusResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunStatusResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunStatusResponseDataVisitor { + type Value = LLMObsPatternsRunStatusResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsRunStatusResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsRunStatusType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsRunStatusResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunStatusResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_run_status_type.rs b/src/datadogV2/model/model_llm_obs_patterns_run_status_type.rs new file mode 100644 index 0000000000..9cf39971db --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_run_status_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsRunStatusType { + TOPIC_DISCOVERY_RUN_STATUS, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsRunStatusType { + fn to_string(&self) -> String { + match self { + Self::TOPIC_DISCOVERY_RUN_STATUS => String::from("topic_discovery_run_status"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsRunStatusType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunStatusType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "topic_discovery_run_status" => Self::TOPIC_DISCOVERY_RUN_STATUS, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_run_summary.rs b/src/datadogV2/model/model_llm_obs_patterns_run_summary.rs new file mode 100644 index 0000000000..cdcea0350d --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_run_summary.rs @@ -0,0 +1,158 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Summary of an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunSummary { + /// Timestamp when the run completed. Null if the run has not completed. + #[serde( + rename = "completed_at", + default, + with = "::serde_with::rust::double_option" + )] + pub completed_at: Option>>, + /// Snapshot of the configuration used for a patterns run. + #[serde(rename = "config_snapshot")] + pub config_snapshot: Option, + /// Timestamp when the run was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Unique identifier of the run. + #[serde(rename = "id")] + pub id: String, + /// Status of the run. + #[serde(rename = "status")] + pub status: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunSummary { + pub fn new( + created_at: chrono::DateTime, + id: String, + status: String, + ) -> LLMObsPatternsRunSummary { + LLMObsPatternsRunSummary { + completed_at: None, + config_snapshot: None, + created_at, + id, + status, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn completed_at(mut self, value: Option>) -> Self { + self.completed_at = Some(value); + self + } + + pub fn config_snapshot( + mut self, + value: crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + ) -> Self { + self.config_snapshot = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunSummary { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunSummaryVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunSummaryVisitor { + type Value = LLMObsPatternsRunSummary; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut completed_at: Option>> = None; + let mut config_snapshot: Option< + crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + > = None; + let mut created_at: Option> = None; + let mut id: Option = None; + let mut status: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "completed_at" => { + completed_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_snapshot" => { + if v.is_null() { + continue; + } + config_snapshot = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + status = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; + + let content = LLMObsPatternsRunSummary { + completed_at, + config_snapshot, + created_at, + id, + status, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunSummaryVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_runs_list_type.rs b/src/datadogV2/model/model_llm_obs_patterns_runs_list_type.rs new file mode 100644 index 0000000000..6ff517b175 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_runs_list_type.rs @@ -0,0 +1,50 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsRunsListType { + LIST_TOPIC_DISCOVERY_RUNS_RESPONSE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsRunsListType { + fn to_string(&self) -> String { + match self { + Self::LIST_TOPIC_DISCOVERY_RUNS_RESPONSE => { + String::from("list_topic_discovery_runs_response") + } + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsRunsListType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunsListType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "list_topic_discovery_runs_response" => Self::LIST_TOPIC_DISCOVERY_RUNS_RESPONSE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_runs_response.rs b/src/datadogV2/model/model_llm_obs_patterns_runs_response.rs new file mode 100644 index 0000000000..be91a92ddf --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_runs_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing the completed runs of an LLM Observability patterns configuration. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunsResponse { + /// Data object of an LLM Observability patterns runs response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsRunsResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunsResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsRunsResponseData, + ) -> LLMObsPatternsRunsResponse { + LLMObsPatternsRunsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunsResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunsResponseVisitor { + type Value = LLMObsPatternsRunsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsRunsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_runs_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_runs_response_attributes.rs new file mode 100644 index 0000000000..1c17eaf6ba --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_runs_response_attributes.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns runs response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunsResponseAttributes { + /// List of patterns runs. + #[serde(rename = "runs")] + pub runs: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunsResponseAttributes { + pub fn new( + runs: Vec, + ) -> LLMObsPatternsRunsResponseAttributes { + LLMObsPatternsRunsResponseAttributes { + runs, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunsResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunsResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunsResponseAttributesVisitor { + type Value = LLMObsPatternsRunsResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut runs: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "runs" => { + runs = 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); + } + } + } + } + let runs = runs.ok_or_else(|| M::Error::missing_field("runs"))?; + + let content = LLMObsPatternsRunsResponseAttributes { + runs, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunsResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_runs_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_runs_response_data.rs new file mode 100644 index 0000000000..5fd83e1b3c --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_runs_response_data.rs @@ -0,0 +1,126 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns runs response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsRunsResponseData { + /// Attributes of an LLM Observability patterns runs response. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsRunsResponseAttributes, + /// Identifier of the configuration the runs belong to. + #[serde(rename = "id")] + pub id: String, + /// Resource type of a list of LLM Observability patterns runs. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsRunsListType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsRunsResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsRunsResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsRunsListType, + ) -> LLMObsPatternsRunsResponseData { + LLMObsPatternsRunsResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsRunsResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsRunsResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsRunsResponseDataVisitor { + type Value = LLMObsPatternsRunsResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsRunsResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsRunsListType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsRunsResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsRunsResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topic.rs b/src/datadogV2/model/model_llm_obs_patterns_topic.rs new file mode 100644 index 0000000000..7fee9b0c42 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topic.rs @@ -0,0 +1,205 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A topic discovered by an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopic { + /// Timestamp when the topic was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Description of the topic. + #[serde(rename = "description")] + pub description: String, + /// Timestamp when the topic was first seen. + #[serde(rename = "first_seen_at")] + pub first_seen_at: chrono::DateTime, + /// Level of the topic in the hierarchy. Level 0 is a leaf topic. + #[serde(rename = "hierarchy_level")] + pub hierarchy_level: i64, + /// Unique identifier of the topic. + #[serde(rename = "id")] + pub id: String, + /// Whether the topic has been validated. + #[serde(rename = "is_validated")] + pub is_validated: bool, + /// Name of the topic. + #[serde(rename = "name")] + pub name: String, + /// Identifier of the parent topic. Empty for top-level topics. + #[serde(rename = "parent_topic_id")] + pub parent_topic_id: String, + /// Number of data points assigned to the topic. + #[serde(rename = "point_count")] + pub point_count: i64, + /// Identifier of the run that produced the topic. + #[serde(rename = "run_id")] + pub run_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopic { + pub fn new( + created_at: chrono::DateTime, + description: String, + first_seen_at: chrono::DateTime, + hierarchy_level: i64, + id: String, + is_validated: bool, + name: String, + parent_topic_id: String, + point_count: i64, + run_id: String, + ) -> LLMObsPatternsTopic { + LLMObsPatternsTopic { + created_at, + description, + first_seen_at, + hierarchy_level, + id, + is_validated, + name, + parent_topic_id, + point_count, + run_id, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopic { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicVisitor { + type Value = LLMObsPatternsTopic; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut created_at: Option> = None; + let mut description: Option = None; + let mut first_seen_at: Option> = None; + let mut hierarchy_level: Option = None; + let mut id: Option = None; + let mut is_validated: Option = None; + let mut name: Option = None; + let mut parent_topic_id: Option = None; + let mut point_count: Option = None; + let mut run_id: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "description" => { + description = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "first_seen_at" => { + first_seen_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_level" => { + hierarchy_level = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "is_validated" => { + is_validated = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "parent_topic_id" => { + parent_topic_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "point_count" => { + point_count = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "run_id" => { + run_id = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let description = + description.ok_or_else(|| M::Error::missing_field("description"))?; + let first_seen_at = + first_seen_at.ok_or_else(|| M::Error::missing_field("first_seen_at"))?; + let hierarchy_level = + hierarchy_level.ok_or_else(|| M::Error::missing_field("hierarchy_level"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let is_validated = + is_validated.ok_or_else(|| M::Error::missing_field("is_validated"))?; + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let parent_topic_id = + parent_topic_id.ok_or_else(|| M::Error::missing_field("parent_topic_id"))?; + let point_count = + point_count.ok_or_else(|| M::Error::missing_field("point_count"))?; + let run_id = run_id.ok_or_else(|| M::Error::missing_field("run_id"))?; + + let content = LLMObsPatternsTopic { + created_at, + description, + first_seen_at, + hierarchy_level, + id, + is_validated, + name, + parent_topic_id, + point_count, + run_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topic_with_clustered_points.rs b/src/datadogV2/model/model_llm_obs_patterns_topic_with_clustered_points.rs new file mode 100644 index 0000000000..752c372b50 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topic_with_clustered_points.rs @@ -0,0 +1,229 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A topic discovered by an LLM Observability patterns run, including the +/// clustered points attached to leaf topics. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicWithClusteredPoints { + /// List of clustered points attached to a topic. + #[serde(rename = "cluster_points")] + pub cluster_points: Option>, + /// Timestamp when the topic was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Description of the topic. + #[serde(rename = "description")] + pub description: String, + /// Timestamp when the topic was first seen. + #[serde(rename = "first_seen_at")] + pub first_seen_at: chrono::DateTime, + /// Level of the topic in the hierarchy. Level 0 is a leaf topic. + #[serde(rename = "hierarchy_level")] + pub hierarchy_level: i64, + /// Unique identifier of the topic. + #[serde(rename = "id")] + pub id: String, + /// Whether the topic has been validated. + #[serde(rename = "is_validated")] + pub is_validated: bool, + /// Name of the topic. + #[serde(rename = "name")] + pub name: String, + /// Identifier of the parent topic. Empty for top-level topics. + #[serde(rename = "parent_topic_id")] + pub parent_topic_id: String, + /// Number of data points assigned to the topic. + #[serde(rename = "point_count")] + pub point_count: i64, + /// Identifier of the run that produced the topic. + #[serde(rename = "run_id")] + pub run_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicWithClusteredPoints { + pub fn new( + created_at: chrono::DateTime, + description: String, + first_seen_at: chrono::DateTime, + hierarchy_level: i64, + id: String, + is_validated: bool, + name: String, + parent_topic_id: String, + point_count: i64, + run_id: String, + ) -> LLMObsPatternsTopicWithClusteredPoints { + LLMObsPatternsTopicWithClusteredPoints { + cluster_points: None, + created_at, + description, + first_seen_at, + hierarchy_level, + id, + is_validated, + name, + parent_topic_id, + point_count, + run_id, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn cluster_points( + mut self, + value: Vec, + ) -> Self { + self.cluster_points = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicWithClusteredPoints { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicWithClusteredPointsVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicWithClusteredPointsVisitor { + type Value = LLMObsPatternsTopicWithClusteredPoints; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut cluster_points: Option< + Vec, + > = None; + let mut created_at: Option> = None; + let mut description: Option = None; + let mut first_seen_at: Option> = None; + let mut hierarchy_level: Option = None; + let mut id: Option = None; + let mut is_validated: Option = None; + let mut name: Option = None; + let mut parent_topic_id: Option = None; + let mut point_count: Option = None; + let mut run_id: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "cluster_points" => { + if v.is_null() { + continue; + } + cluster_points = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "description" => { + description = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "first_seen_at" => { + first_seen_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "hierarchy_level" => { + hierarchy_level = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "is_validated" => { + is_validated = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "name" => { + name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "parent_topic_id" => { + parent_topic_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "point_count" => { + point_count = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "run_id" => { + run_id = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let description = + description.ok_or_else(|| M::Error::missing_field("description"))?; + let first_seen_at = + first_seen_at.ok_or_else(|| M::Error::missing_field("first_seen_at"))?; + let hierarchy_level = + hierarchy_level.ok_or_else(|| M::Error::missing_field("hierarchy_level"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let is_validated = + is_validated.ok_or_else(|| M::Error::missing_field("is_validated"))?; + let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let parent_topic_id = + parent_topic_id.ok_or_else(|| M::Error::missing_field("parent_topic_id"))?; + let point_count = + point_count.ok_or_else(|| M::Error::missing_field("point_count"))?; + let run_id = run_id.ok_or_else(|| M::Error::missing_field("run_id"))?; + + let content = LLMObsPatternsTopicWithClusteredPoints { + cluster_points, + created_at, + description, + first_seen_at, + hierarchy_level, + id, + is_validated, + name, + parent_topic_id, + point_count, + run_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicWithClusteredPointsVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_response.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_response.rs new file mode 100644 index 0000000000..cb44b1c198 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing the topics discovered by an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsResponse { + /// Data object of an LLM Observability patterns topics response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsTopicsResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsTopicsResponseData, + ) -> LLMObsPatternsTopicsResponse { + LLMObsPatternsTopicsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsResponseVisitor { + type Value = LLMObsPatternsTopicsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsTopicsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_response_attributes.rs new file mode 100644 index 0000000000..f95c7e17b0 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_response_attributes.rs @@ -0,0 +1,182 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns topics response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsResponseAttributes { + /// Timestamp when the run completed. Null if the run has not completed. + #[serde( + rename = "completed_at", + default, + with = "::serde_with::rust::double_option" + )] + pub completed_at: Option>>, + /// Identifier of the configuration that produced the run. + #[serde(rename = "config_id")] + pub config_id: String, + /// Snapshot of the configuration used for a patterns run. + #[serde(rename = "config_snapshot")] + pub config_snapshot: Option, + /// Timestamp when the run was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Identifier of the run that completed immediately before this one. Empty if none. + #[serde(rename = "previous_run_id")] + pub previous_run_id: String, + /// Identifier of the run that produced the topics. + #[serde(rename = "run_id")] + pub run_id: String, + /// List of discovered topics. + #[serde(rename = "topics")] + pub topics: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsResponseAttributes { + pub fn new( + config_id: String, + created_at: chrono::DateTime, + previous_run_id: String, + run_id: String, + topics: Vec, + ) -> LLMObsPatternsTopicsResponseAttributes { + LLMObsPatternsTopicsResponseAttributes { + completed_at: None, + config_id, + config_snapshot: None, + created_at, + previous_run_id, + run_id, + topics, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn completed_at(mut self, value: Option>) -> Self { + self.completed_at = Some(value); + self + } + + pub fn config_snapshot( + mut self, + value: crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + ) -> Self { + self.config_snapshot = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsResponseAttributesVisitor { + type Value = LLMObsPatternsTopicsResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut completed_at: Option>> = None; + let mut config_id: Option = None; + let mut config_snapshot: Option< + crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + > = None; + let mut created_at: Option> = None; + let mut previous_run_id: Option = None; + let mut run_id: Option = None; + let mut topics: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "completed_at" => { + completed_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_id" => { + config_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_snapshot" => { + if v.is_null() { + continue; + } + config_snapshot = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "previous_run_id" => { + previous_run_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "run_id" => { + run_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "topics" => { + topics = 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); + } + } + } + } + let config_id = config_id.ok_or_else(|| M::Error::missing_field("config_id"))?; + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let previous_run_id = + previous_run_id.ok_or_else(|| M::Error::missing_field("previous_run_id"))?; + let run_id = run_id.ok_or_else(|| M::Error::missing_field("run_id"))?; + let topics = topics.ok_or_else(|| M::Error::missing_field("topics"))?; + + let content = LLMObsPatternsTopicsResponseAttributes { + completed_at, + config_id, + config_snapshot, + created_at, + previous_run_id, + run_id, + topics, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicsResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_response_data.rs new file mode 100644 index 0000000000..1e2f330260 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_response_data.rs @@ -0,0 +1,126 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns topics response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsResponseData { + /// Attributes of an LLM Observability patterns topics response. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsTopicsResponseAttributes, + /// Identifier of the run the topics belong to. + #[serde(rename = "id")] + pub id: String, + /// Resource type of an LLM Observability patterns topics response. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsTopicsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsTopicsResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsTopicsType, + ) -> LLMObsPatternsTopicsResponseData { + LLMObsPatternsTopicsResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsResponseDataVisitor { + type Value = LLMObsPatternsTopicsResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsTopicsResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsTopicsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsTopicsResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicsResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_type.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_type.rs new file mode 100644 index 0000000000..1e251bb8c8 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsTopicsType { + GET_TOPICS_RESPONSE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsTopicsType { + fn to_string(&self) -> String { + match self { + Self::GET_TOPICS_RESPONSE => String::from("get_topics_response"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsTopicsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "get_topics_response" => Self::GET_TOPICS_RESPONSE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response.rs new file mode 100644 index 0000000000..4bfa59c431 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response.rs @@ -0,0 +1,97 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response containing the topics, and the clustered points of their leaf topics, +/// discovered by an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsWithClusteredPointsResponse { + /// Data object of an LLM Observability patterns topics-with-clustered-points response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsWithClusteredPointsResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponseData, + ) -> LLMObsPatternsTopicsWithClusteredPointsResponse { + LLMObsPatternsTopicsWithClusteredPointsResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsWithClusteredPointsResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsWithClusteredPointsResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsWithClusteredPointsResponseVisitor { + type Value = LLMObsPatternsTopicsWithClusteredPointsResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option< + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponseData, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsTopicsWithClusteredPointsResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicsWithClusteredPointsResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_attributes.rs new file mode 100644 index 0000000000..817c92a637 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_attributes.rs @@ -0,0 +1,185 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns topics-with-clustered-points response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + /// Timestamp when the run completed. Null if the run has not completed. + #[serde( + rename = "completed_at", + default, + with = "::serde_with::rust::double_option" + )] + pub completed_at: Option>>, + /// Identifier of the configuration that produced the run. + #[serde(rename = "config_id")] + pub config_id: String, + /// Snapshot of the configuration used for a patterns run. + #[serde(rename = "config_snapshot")] + pub config_snapshot: Option, + /// Timestamp when the run was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// Identifier of the run that completed immediately before this one. Empty if none. + #[serde(rename = "previous_run_id")] + pub previous_run_id: String, + /// Identifier of the run that produced the topics. + #[serde(rename = "run_id")] + pub run_id: String, + /// List of discovered topics with their clustered points. + #[serde(rename = "topics")] + pub topics: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + pub fn new( + config_id: String, + created_at: chrono::DateTime, + previous_run_id: String, + run_id: String, + topics: Vec, + ) -> LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + completed_at: None, + config_id, + config_snapshot: None, + created_at, + previous_run_id, + run_id, + topics, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn completed_at(mut self, value: Option>) -> Self { + self.completed_at = Some(value); + self + } + + pub fn config_snapshot( + mut self, + value: crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + ) -> Self { + self.config_snapshot = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsWithClusteredPointsResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsWithClusteredPointsResponseAttributesVisitor { + type Value = LLMObsPatternsTopicsWithClusteredPointsResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut completed_at: Option>> = None; + let mut config_id: Option = None; + let mut config_snapshot: Option< + crate::datadogV2::model::LLMObsPatternsConfigSnapshot, + > = None; + let mut created_at: Option> = None; + let mut previous_run_id: Option = None; + let mut run_id: Option = None; + let mut topics: Option< + Vec, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "completed_at" => { + completed_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_id" => { + config_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "config_snapshot" => { + if v.is_null() { + continue; + } + config_snapshot = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "previous_run_id" => { + previous_run_id = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "run_id" => { + run_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "topics" => { + topics = 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); + } + } + } + } + let config_id = config_id.ok_or_else(|| M::Error::missing_field("config_id"))?; + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let previous_run_id = + previous_run_id.ok_or_else(|| M::Error::missing_field("previous_run_id"))?; + let run_id = run_id.ok_or_else(|| M::Error::missing_field("run_id"))?; + let topics = topics.ok_or_else(|| M::Error::missing_field("topics"))?; + + let content = LLMObsPatternsTopicsWithClusteredPointsResponseAttributes { + completed_at, + config_id, + config_snapshot, + created_at, + previous_run_id, + run_id, + topics, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer + .deserialize_any(LLMObsPatternsTopicsWithClusteredPointsResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_data.rs new file mode 100644 index 0000000000..813ce97e02 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_response_data.rs @@ -0,0 +1,127 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns topics-with-clustered-points response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTopicsWithClusteredPointsResponseData { + /// Attributes of an LLM Observability patterns topics-with-clustered-points response. + #[serde(rename = "attributes")] + pub attributes: + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponseAttributes, + /// Identifier of the run the topics belong to. + #[serde(rename = "id")] + pub id: String, + /// Resource type of an LLM Observability patterns topics-with-clustered-points response. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTopicsWithClusteredPointsResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsType, + ) -> LLMObsPatternsTopicsWithClusteredPointsResponseData { + LLMObsPatternsTopicsWithClusteredPointsResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsWithClusteredPointsResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTopicsWithClusteredPointsResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTopicsWithClusteredPointsResponseDataVisitor { + type Value = LLMObsPatternsTopicsWithClusteredPointsResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option = None; + let mut id: Option = None; + let mut type_: Option< + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsTopicsWithClusteredPointsType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsTopicsWithClusteredPointsResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTopicsWithClusteredPointsResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_type.rs b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_type.rs new file mode 100644 index 0000000000..ad671b6a20 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_topics_with_clustered_points_type.rs @@ -0,0 +1,52 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsTopicsWithClusteredPointsType { + GET_TOPICS_WITH_CLUSTER_POINTS_RESPONSE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsTopicsWithClusteredPointsType { + fn to_string(&self) -> String { + match self { + Self::GET_TOPICS_WITH_CLUSTER_POINTS_RESPONSE => { + String::from("get_topics_with_cluster_points_response") + } + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsTopicsWithClusteredPointsType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTopicsWithClusteredPointsType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "get_topics_with_cluster_points_response" => { + Self::GET_TOPICS_WITH_CLUSTER_POINTS_RESPONSE + } + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_request.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_request.rs new file mode 100644 index 0000000000..e78e6c281d --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_request.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Request to trigger an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerRequest { + /// Data object for triggering an LLM Observability patterns run. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsTriggerRequestData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerRequest { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsTriggerRequestData, + ) -> LLMObsPatternsTriggerRequest { + LLMObsPatternsTriggerRequest { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerRequest { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerRequestVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerRequestVisitor { + type Value = LLMObsPatternsTriggerRequest; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsTriggerRequest { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerRequestVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_request_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_request_attributes.rs new file mode 100644 index 0000000000..80152e7b9d --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_request_attributes.rs @@ -0,0 +1,92 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes for triggering an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerRequestAttributes { + /// The ID of the patterns configuration to run. + #[serde(rename = "config_id")] + pub config_id: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerRequestAttributes { + pub fn new(config_id: String) -> LLMObsPatternsTriggerRequestAttributes { + LLMObsPatternsTriggerRequestAttributes { + config_id, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerRequestAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerRequestAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerRequestAttributesVisitor { + type Value = LLMObsPatternsTriggerRequestAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut config_id: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "config_id" => { + config_id = 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); + } + } + } + } + let config_id = config_id.ok_or_else(|| M::Error::missing_field("config_id"))?; + + let content = LLMObsPatternsTriggerRequestAttributes { + config_id, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerRequestAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_request_data.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_request_data.rs new file mode 100644 index 0000000000..6d79336db4 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_request_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object for triggering an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerRequestData { + /// Attributes for triggering an LLM Observability patterns run. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsTriggerRequestAttributes, + /// Resource type for triggering an LLM Observability patterns run. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsRequestType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerRequestData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsTriggerRequestAttributes, + type_: crate::datadogV2::model::LLMObsPatternsRequestType, + ) -> LLMObsPatternsTriggerRequestData { + LLMObsPatternsTriggerRequestData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerRequestData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerRequestDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerRequestDataVisitor { + type Value = LLMObsPatternsTriggerRequestData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsTriggerRequestAttributes, + > = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsRequestType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsTriggerRequestData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerRequestDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_response.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_response.rs new file mode 100644 index 0000000000..cdeb04a48b --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_response.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Response after triggering an LLM Observability patterns run. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerResponse { + /// Data object of an LLM Observability patterns trigger response. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::LLMObsPatternsTriggerResponseData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerResponse { + pub fn new( + data: crate::datadogV2::model::LLMObsPatternsTriggerResponseData, + ) -> LLMObsPatternsTriggerResponse { + LLMObsPatternsTriggerResponse { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerResponseVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerResponseVisitor { + type Value = LLMObsPatternsTriggerResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = LLMObsPatternsTriggerResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_response_attributes.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_attributes.rs new file mode 100644 index 0000000000..cc77d48dc8 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_attributes.rs @@ -0,0 +1,116 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of an LLM Observability patterns trigger response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerResponseAttributes { + /// The ID of the patterns configuration that was run. + #[serde(rename = "config_id")] + pub config_id: String, + /// The ID of the patterns run that was started. + #[serde(rename = "run_id")] + pub run_id: String, + /// Status of the patterns run. + #[serde(rename = "status")] + pub status: String, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerResponseAttributes { + pub fn new( + config_id: String, + run_id: String, + status: String, + ) -> LLMObsPatternsTriggerResponseAttributes { + LLMObsPatternsTriggerResponseAttributes { + config_id, + run_id, + status, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerResponseAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerResponseAttributesVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerResponseAttributesVisitor { + type Value = LLMObsPatternsTriggerResponseAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut config_id: Option = None; + let mut run_id: Option = None; + let mut status: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "config_id" => { + config_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "run_id" => { + run_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "status" => { + status = 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); + } + } + } + } + let config_id = config_id.ok_or_else(|| M::Error::missing_field("config_id"))?; + let run_id = run_id.ok_or_else(|| M::Error::missing_field("run_id"))?; + let status = status.ok_or_else(|| M::Error::missing_field("status"))?; + + let content = LLMObsPatternsTriggerResponseAttributes { + config_id, + run_id, + status, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerResponseAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_response_data.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_data.rs new file mode 100644 index 0000000000..2e74388186 --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_data.rs @@ -0,0 +1,127 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object of an LLM Observability patterns trigger response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct LLMObsPatternsTriggerResponseData { + /// Attributes of an LLM Observability patterns trigger response. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::LLMObsPatternsTriggerResponseAttributes, + /// The ID of the patterns configuration that was run. + #[serde(rename = "id")] + pub id: String, + /// Resource type of an LLM Observability patterns trigger response. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::LLMObsPatternsTriggerResponseType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl LLMObsPatternsTriggerResponseData { + pub fn new( + attributes: crate::datadogV2::model::LLMObsPatternsTriggerResponseAttributes, + id: String, + type_: crate::datadogV2::model::LLMObsPatternsTriggerResponseType, + ) -> LLMObsPatternsTriggerResponseData { + LLMObsPatternsTriggerResponseData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct LLMObsPatternsTriggerResponseDataVisitor; + impl<'a> Visitor<'a> for LLMObsPatternsTriggerResponseDataVisitor { + type Value = LLMObsPatternsTriggerResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::LLMObsPatternsTriggerResponseAttributes, + > = None; + let mut id: Option = None; + let mut type_: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::LLMObsPatternsTriggerResponseType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = LLMObsPatternsTriggerResponseData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(LLMObsPatternsTriggerResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_llm_obs_patterns_trigger_response_type.rs b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_type.rs new file mode 100644 index 0000000000..5837fdc5de --- /dev/null +++ b/src/datadogV2/model/model_llm_obs_patterns_trigger_response_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum LLMObsPatternsTriggerResponseType { + TOPIC_DISCOVERY_RUN, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for LLMObsPatternsTriggerResponseType { + fn to_string(&self) -> String { + match self { + Self::TOPIC_DISCOVERY_RUN => String::from("topic_discovery_run"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for LLMObsPatternsTriggerResponseType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for LLMObsPatternsTriggerResponseType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "topic_discovery_run" => Self::TOPIC_DISCOVERY_RUN, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_max_session_duration_type.rs b/src/datadogV2/model/model_max_session_duration_type.rs new file mode 100644 index 0000000000..d8172fd1e7 --- /dev/null +++ b/src/datadogV2/model/model_max_session_duration_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum MaxSessionDurationType { + MAX_SESSION_DURATION, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for MaxSessionDurationType { + fn to_string(&self) -> String { + match self { + Self::MAX_SESSION_DURATION => String::from("max_session_duration"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for MaxSessionDurationType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for MaxSessionDurationType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "max_session_duration" => Self::MAX_SESSION_DURATION, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_max_session_duration_update_attributes.rs b/src/datadogV2/model/model_max_session_duration_update_attributes.rs new file mode 100644 index 0000000000..d93538e36f --- /dev/null +++ b/src/datadogV2/model/model_max_session_duration_update_attributes.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes for the maximum session duration update request. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct MaxSessionDurationUpdateAttributes { + /// The maximum session duration, in seconds. + #[serde(rename = "max_session_duration")] + pub max_session_duration: i64, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl MaxSessionDurationUpdateAttributes { + pub fn new(max_session_duration: i64) -> MaxSessionDurationUpdateAttributes { + MaxSessionDurationUpdateAttributes { + max_session_duration, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for MaxSessionDurationUpdateAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct MaxSessionDurationUpdateAttributesVisitor; + impl<'a> Visitor<'a> for MaxSessionDurationUpdateAttributesVisitor { + type Value = MaxSessionDurationUpdateAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut max_session_duration: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "max_session_duration" => { + max_session_duration = + 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); + } + } + } + } + let max_session_duration = max_session_duration + .ok_or_else(|| M::Error::missing_field("max_session_duration"))?; + + let content = MaxSessionDurationUpdateAttributes { + max_session_duration, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(MaxSessionDurationUpdateAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_max_session_duration_update_data.rs b/src/datadogV2/model/model_max_session_duration_update_data.rs new file mode 100644 index 0000000000..92df063802 --- /dev/null +++ b/src/datadogV2/model/model_max_session_duration_update_data.rs @@ -0,0 +1,115 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The data object for a maximum session duration update request. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct MaxSessionDurationUpdateData { + /// Attributes for the maximum session duration update request. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::MaxSessionDurationUpdateAttributes, + /// Data type of a maximum session duration update. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::MaxSessionDurationType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl MaxSessionDurationUpdateData { + pub fn new( + attributes: crate::datadogV2::model::MaxSessionDurationUpdateAttributes, + type_: crate::datadogV2::model::MaxSessionDurationType, + ) -> MaxSessionDurationUpdateData { + MaxSessionDurationUpdateData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for MaxSessionDurationUpdateData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct MaxSessionDurationUpdateDataVisitor; + impl<'a> Visitor<'a> for MaxSessionDurationUpdateDataVisitor { + type Value = MaxSessionDurationUpdateData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option< + crate::datadogV2::model::MaxSessionDurationUpdateAttributes, + > = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::MaxSessionDurationType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = MaxSessionDurationUpdateData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(MaxSessionDurationUpdateDataVisitor) + } +} diff --git a/src/datadogV2/model/model_max_session_duration_update_request.rs b/src/datadogV2/model/model_max_session_duration_update_request.rs new file mode 100644 index 0000000000..2c773b4c8f --- /dev/null +++ b/src/datadogV2/model/model_max_session_duration_update_request.rs @@ -0,0 +1,94 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A request to update the maximum session duration for an organization. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct MaxSessionDurationUpdateRequest { + /// The data object for a maximum session duration update request. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::MaxSessionDurationUpdateData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl MaxSessionDurationUpdateRequest { + pub fn new( + data: crate::datadogV2::model::MaxSessionDurationUpdateData, + ) -> MaxSessionDurationUpdateRequest { + MaxSessionDurationUpdateRequest { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for MaxSessionDurationUpdateRequest { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct MaxSessionDurationUpdateRequestVisitor; + impl<'a> Visitor<'a> for MaxSessionDurationUpdateRequestVisitor { + type Value = MaxSessionDurationUpdateRequest; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = MaxSessionDurationUpdateRequest { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(MaxSessionDurationUpdateRequestVisitor) + } +} diff --git a/src/datadogV2/model/model_observability_pipeline_config_processor_item.rs b/src/datadogV2/model/model_observability_pipeline_config_processor_item.rs index 1143f4197b..241bf1e121 100644 --- a/src/datadogV2/model/model_observability_pipeline_config_processor_item.rs +++ b/src/datadogV2/model/model_observability_pipeline_config_processor_item.rs @@ -35,6 +35,9 @@ pub enum ObservabilityPipelineConfigProcessorItem { ObservabilityPipelineGenerateMetricsProcessor( Box, ), + ObservabilityPipelineGenerateMetricsV2Processor( + Box, + ), ObservabilityPipelineOcsfMapperProcessor( Box, ), @@ -179,6 +182,14 @@ impl<'de> Deserialize<'de> for ObservabilityPipelineConfigProcessorItem { return Ok(ObservabilityPipelineConfigProcessorItem::ObservabilityPipelineGenerateMetricsProcessor(_v)); } } + if let Ok(_v) = serde_json::from_value::< + Box, + >(value.clone()) + { + if !_v._unparsed { + return Ok(ObservabilityPipelineConfigProcessorItem::ObservabilityPipelineGenerateMetricsV2Processor(_v)); + } + } if let Ok(_v) = serde_json::from_value::< Box, >(value.clone()) diff --git a/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor.rs b/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor.rs new file mode 100644 index 0000000000..963a351f26 --- /dev/null +++ b/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor.rs @@ -0,0 +1,187 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The `generate_metrics` processor creates custom metrics from logs. +/// Metrics can be counters, gauges, or distributions and optionally grouped by log fields. +/// The generated metrics must be routed to a metrics destination using the input `.metrics`. +/// +/// **Supported pipeline types:** logs +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct ObservabilityPipelineGenerateMetricsV2Processor { + /// The display name for a component. + #[serde(rename = "display_name")] + pub display_name: Option, + /// Indicates whether the processor is enabled. + #[serde(rename = "enabled")] + pub enabled: bool, + /// The unique identifier for this component. Used to reference this component in other parts of the pipeline. + #[serde(rename = "id")] + pub id: String, + /// A Datadog search query used to determine which logs this processor targets. + #[serde(rename = "include")] + pub include: Option, + /// Configuration for generating individual metrics. + #[serde(rename = "metrics")] + pub metrics: Option>, + /// The processor type. Always `generate_metrics`. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::ObservabilityPipelineGenerateMetricsV2ProcessorType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl ObservabilityPipelineGenerateMetricsV2Processor { + pub fn new( + enabled: bool, + id: String, + type_: crate::datadogV2::model::ObservabilityPipelineGenerateMetricsV2ProcessorType, + ) -> ObservabilityPipelineGenerateMetricsV2Processor { + ObservabilityPipelineGenerateMetricsV2Processor { + display_name: None, + enabled, + id, + include: None, + metrics: None, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn display_name(mut self, value: String) -> Self { + self.display_name = Some(value); + self + } + + pub fn include(mut self, value: String) -> Self { + self.include = Some(value); + self + } + + pub fn metrics( + mut self, + value: Vec, + ) -> Self { + self.metrics = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for ObservabilityPipelineGenerateMetricsV2Processor { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct ObservabilityPipelineGenerateMetricsV2ProcessorVisitor; + impl<'a> Visitor<'a> for ObservabilityPipelineGenerateMetricsV2ProcessorVisitor { + type Value = ObservabilityPipelineGenerateMetricsV2Processor; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut display_name: Option = None; + let mut enabled: Option = None; + let mut id: Option = None; + let mut include: Option = None; + let mut metrics: Option< + Vec, + > = None; + let mut type_: Option< + crate::datadogV2::model::ObservabilityPipelineGenerateMetricsV2ProcessorType, + > = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "display_name" => { + if v.is_null() { + continue; + } + display_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "enabled" => { + enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "include" => { + if v.is_null() { + continue; + } + include = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "metrics" => { + if v.is_null() { + continue; + } + metrics = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::ObservabilityPipelineGenerateMetricsV2ProcessorType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let enabled = enabled.ok_or_else(|| M::Error::missing_field("enabled"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = ObservabilityPipelineGenerateMetricsV2Processor { + display_name, + enabled, + id, + include, + metrics, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(ObservabilityPipelineGenerateMetricsV2ProcessorVisitor) + } +} diff --git a/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor_type.rs b/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor_type.rs new file mode 100644 index 0000000000..09b235ac45 --- /dev/null +++ b/src/datadogV2/model/model_observability_pipeline_generate_metrics_v2_processor_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum ObservabilityPipelineGenerateMetricsV2ProcessorType { + GENERATE_METRICS, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for ObservabilityPipelineGenerateMetricsV2ProcessorType { + fn to_string(&self) -> String { + match self { + Self::GENERATE_METRICS => String::from("generate_metrics"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for ObservabilityPipelineGenerateMetricsV2ProcessorType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for ObservabilityPipelineGenerateMetricsV2ProcessorType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "generate_metrics" => Self::GENERATE_METRICS, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling.rs b/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling.rs deleted file mode 100644 index 406f1c0876..0000000000 --- a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling.rs +++ /dev/null @@ -1,160 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Cross-product retention settings for a hardcoded retention filter. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedCrossProductSampling { - /// Indicates whether Session Replay cross-product retention is active. - #[serde(rename = "session_replay_enabled")] - pub session_replay_enabled: Option, - /// Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - #[serde(rename = "session_replay_sample_rate")] - pub session_replay_sample_rate: Option, - /// Indicates whether Trace cross-product retention is active. - #[serde(rename = "trace_enabled")] - pub trace_enabled: Option, - /// Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - #[serde(rename = "trace_sample_rate")] - pub trace_sample_rate: Option, - #[serde(flatten)] - pub additional_properties: std::collections::BTreeMap, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl RumHardcodedCrossProductSampling { - pub fn new() -> RumHardcodedCrossProductSampling { - RumHardcodedCrossProductSampling { - session_replay_enabled: None, - session_replay_sample_rate: None, - trace_enabled: None, - trace_sample_rate: None, - additional_properties: std::collections::BTreeMap::new(), - _unparsed: false, - } - } - - pub fn session_replay_enabled(mut self, value: bool) -> Self { - self.session_replay_enabled = Some(value); - self - } - - pub fn session_replay_sample_rate(mut self, value: f64) -> Self { - self.session_replay_sample_rate = Some(value); - self - } - - pub fn trace_enabled(mut self, value: bool) -> Self { - self.trace_enabled = Some(value); - self - } - - pub fn trace_sample_rate(mut self, value: f64) -> Self { - self.trace_sample_rate = Some(value); - self - } - - pub fn additional_properties( - mut self, - value: std::collections::BTreeMap, - ) -> Self { - self.additional_properties = value; - self - } -} - -impl Default for RumHardcodedCrossProductSampling { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for RumHardcodedCrossProductSampling { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct RumHardcodedCrossProductSamplingVisitor; - impl<'a> Visitor<'a> for RumHardcodedCrossProductSamplingVisitor { - type Value = RumHardcodedCrossProductSampling; - - fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.write_str("a mapping") - } - - fn visit_map(self, mut map: M) -> Result - where - M: MapAccess<'a>, - { - let mut session_replay_enabled: Option = None; - let mut session_replay_sample_rate: Option = None; - let mut trace_enabled: Option = None; - let mut trace_sample_rate: Option = None; - let mut additional_properties: std::collections::BTreeMap< - String, - serde_json::Value, - > = std::collections::BTreeMap::new(); - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "session_replay_enabled" => { - if v.is_null() { - continue; - } - session_replay_enabled = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "session_replay_sample_rate" => { - if v.is_null() || v.as_str() == Some("") { - continue; - } - session_replay_sample_rate = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "trace_enabled" => { - if v.is_null() { - continue; - } - trace_enabled = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "trace_sample_rate" => { - if v.is_null() || v.as_str() == Some("") { - continue; - } - trace_sample_rate = - 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); - } - } - } - } - - let content = RumHardcodedCrossProductSampling { - session_replay_enabled, - session_replay_sample_rate, - trace_enabled, - trace_sample_rate, - additional_properties, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(RumHardcodedCrossProductSamplingVisitor) - } -} diff --git a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_update.rs b/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_update.rs deleted file mode 100644 index fc8e43880e..0000000000 --- a/src/datadogV2/model/model_rum_hardcoded_cross_product_sampling_update.rs +++ /dev/null @@ -1,163 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Partial update for cross-product retention of a hardcoded retention filter. -/// Only fields whose matching flag in `cross_product_sampling_editability` is `true` can be updated. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedCrossProductSamplingUpdate { - /// Controls whether Session Replay cross-product retention is active. Omit to leave unchanged. - #[serde(rename = "session_replay_enabled")] - pub session_replay_enabled: Option, - /// Percentage (0–100) of retained sessions with an ingested replay whose replay data is kept. - /// Omit to leave unchanged. - #[serde(rename = "session_replay_sample_rate")] - pub session_replay_sample_rate: Option, - /// Controls whether Trace cross-product retention is active. Omit to leave unchanged. - #[serde(rename = "trace_enabled")] - pub trace_enabled: Option, - /// Percentage (0–100) of retained sessions with ingested traces whose traces are indexed. - /// Omit to leave unchanged. - #[serde(rename = "trace_sample_rate")] - pub trace_sample_rate: Option, - #[serde(flatten)] - pub additional_properties: std::collections::BTreeMap, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl RumHardcodedCrossProductSamplingUpdate { - pub fn new() -> RumHardcodedCrossProductSamplingUpdate { - RumHardcodedCrossProductSamplingUpdate { - session_replay_enabled: None, - session_replay_sample_rate: None, - trace_enabled: None, - trace_sample_rate: None, - additional_properties: std::collections::BTreeMap::new(), - _unparsed: false, - } - } - - pub fn session_replay_enabled(mut self, value: bool) -> Self { - self.session_replay_enabled = Some(value); - self - } - - pub fn session_replay_sample_rate(mut self, value: f64) -> Self { - self.session_replay_sample_rate = Some(value); - self - } - - pub fn trace_enabled(mut self, value: bool) -> Self { - self.trace_enabled = Some(value); - self - } - - pub fn trace_sample_rate(mut self, value: f64) -> Self { - self.trace_sample_rate = Some(value); - self - } - - pub fn additional_properties( - mut self, - value: std::collections::BTreeMap, - ) -> Self { - self.additional_properties = value; - self - } -} - -impl Default for RumHardcodedCrossProductSamplingUpdate { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for RumHardcodedCrossProductSamplingUpdate { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct RumHardcodedCrossProductSamplingUpdateVisitor; - impl<'a> Visitor<'a> for RumHardcodedCrossProductSamplingUpdateVisitor { - type Value = RumHardcodedCrossProductSamplingUpdate; - - fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.write_str("a mapping") - } - - fn visit_map(self, mut map: M) -> Result - where - M: MapAccess<'a>, - { - let mut session_replay_enabled: Option = None; - let mut session_replay_sample_rate: Option = None; - let mut trace_enabled: Option = None; - let mut trace_sample_rate: Option = None; - let mut additional_properties: std::collections::BTreeMap< - String, - serde_json::Value, - > = std::collections::BTreeMap::new(); - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "session_replay_enabled" => { - if v.is_null() { - continue; - } - session_replay_enabled = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "session_replay_sample_rate" => { - if v.is_null() || v.as_str() == Some("") { - continue; - } - session_replay_sample_rate = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "trace_enabled" => { - if v.is_null() { - continue; - } - trace_enabled = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "trace_sample_rate" => { - if v.is_null() || v.as_str() == Some("") { - continue; - } - trace_sample_rate = - 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); - } - } - } - } - - let content = RumHardcodedCrossProductSamplingUpdate { - session_replay_enabled, - session_replay_sample_rate, - trace_enabled, - trace_sample_rate, - additional_properties, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(RumHardcodedCrossProductSamplingUpdateVisitor) - } -} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_attributes.rs b/src/datadogV2/model/model_rum_hardcoded_retention_filter_attributes.rs deleted file mode 100644 index cd6314cb58..0000000000 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_attributes.rs +++ /dev/null @@ -1,234 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// The attributes of a hardcoded retention filter. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterAttributes { - /// Cross-product retention settings for a hardcoded retention filter. - #[serde(rename = "cross_product_sampling")] - pub cross_product_sampling: Option, - /// Flags indicating which `cross_product_sampling` fields can be updated. Read-only. - #[serde(rename = "cross_product_sampling_editability")] - pub cross_product_sampling_editability: - Option, - /// Indicates whether the hardcoded retention filter is active. Read-only. - #[serde(rename = "enabled")] - pub enabled: Option, - /// The type of RUM events the hardcoded filter applies to. Read-only. - #[serde(rename = "event_type")] - pub event_type: Option, - /// The name of the hardcoded retention filter. Read-only. - #[serde(rename = "name")] - pub name: Option, - /// The query string for the hardcoded retention filter. Read-only. - #[serde(rename = "query")] - pub query: Option, - /// The retention sample rate (0–100) for the hardcoded filter. Read-only. - #[serde(rename = "sample_rate")] - pub sample_rate: Option, - #[serde(flatten)] - pub additional_properties: std::collections::BTreeMap, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl RumHardcodedRetentionFilterAttributes { - pub fn new() -> RumHardcodedRetentionFilterAttributes { - RumHardcodedRetentionFilterAttributes { - cross_product_sampling: None, - cross_product_sampling_editability: None, - enabled: None, - event_type: None, - name: None, - query: None, - sample_rate: None, - additional_properties: std::collections::BTreeMap::new(), - _unparsed: false, - } - } - - pub fn cross_product_sampling( - mut self, - value: crate::datadogV2::model::RumHardcodedCrossProductSampling, - ) -> Self { - self.cross_product_sampling = Some(value); - self - } - - pub fn cross_product_sampling_editability( - mut self, - value: crate::datadogV2::model::RumHardcodedCrossProductSamplingEditability, - ) -> Self { - self.cross_product_sampling_editability = Some(value); - self - } - - pub fn enabled(mut self, value: bool) -> Self { - self.enabled = Some(value); - self - } - - pub fn event_type( - mut self, - value: crate::datadogV2::model::RumHardcodedRetentionFilterEventType, - ) -> Self { - self.event_type = Some(value); - self - } - - pub fn name(mut self, value: String) -> Self { - self.name = Some(value); - self - } - - pub fn query(mut self, value: String) -> Self { - self.query = Some(value); - self - } - - pub fn sample_rate(mut self, value: f64) -> Self { - self.sample_rate = Some(value); - self - } - - pub fn additional_properties( - mut self, - value: std::collections::BTreeMap, - ) -> Self { - self.additional_properties = value; - self - } -} - -impl Default for RumHardcodedRetentionFilterAttributes { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterAttributes { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct RumHardcodedRetentionFilterAttributesVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterAttributesVisitor { - type Value = RumHardcodedRetentionFilterAttributes; - - fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.write_str("a mapping") - } - - fn visit_map(self, mut map: M) -> Result - where - M: MapAccess<'a>, - { - let mut cross_product_sampling: Option< - crate::datadogV2::model::RumHardcodedCrossProductSampling, - > = None; - let mut cross_product_sampling_editability: Option< - crate::datadogV2::model::RumHardcodedCrossProductSamplingEditability, - > = None; - let mut enabled: Option = None; - let mut event_type: Option< - crate::datadogV2::model::RumHardcodedRetentionFilterEventType, - > = None; - let mut name: Option = None; - let mut query: Option = None; - let mut sample_rate: Option = None; - let mut additional_properties: std::collections::BTreeMap< - String, - serde_json::Value, - > = std::collections::BTreeMap::new(); - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "cross_product_sampling" => { - if v.is_null() { - continue; - } - cross_product_sampling = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cross_product_sampling_editability" => { - if v.is_null() { - continue; - } - cross_product_sampling_editability = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "enabled" => { - if v.is_null() { - continue; - } - enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "event_type" => { - if v.is_null() { - continue; - } - event_type = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _event_type) = event_type { - match _event_type { - crate::datadogV2::model::RumHardcodedRetentionFilterEventType::UnparsedObject(_event_type) => { - _unparsed = true; - }, - _ => {} - } - } - } - "name" => { - if v.is_null() { - continue; - } - name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "query" => { - if v.is_null() { - continue; - } - query = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "sample_rate" => { - if v.is_null() || v.as_str() == Some("") { - continue; - } - sample_rate = - 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); - } - } - } - } - - let content = RumHardcodedRetentionFilterAttributes { - cross_product_sampling, - cross_product_sampling_editability, - enabled, - event_type, - name, - query, - sample_rate, - additional_properties, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(RumHardcodedRetentionFilterAttributesVisitor) - } -} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_meta.rs b/src/datadogV2/model/model_rum_hardcoded_retention_filter_meta.rs deleted file mode 100644 index 7ff9d1f067..0000000000 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_meta.rs +++ /dev/null @@ -1,153 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Metadata about the hardcoded retention filter. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterMeta { - /// The source of the last update to a hardcoded retention filter. - #[serde(rename = "source")] - pub source: Option, - /// Unix epoch (in milliseconds) of the last update. - #[serde(rename = "updated_at")] - pub updated_at: Option, - /// Handle of the user who last updated the filter. - #[serde(rename = "updated_by_handle")] - pub updated_by_handle: Option, - #[serde(flatten)] - pub additional_properties: std::collections::BTreeMap, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl RumHardcodedRetentionFilterMeta { - pub fn new() -> RumHardcodedRetentionFilterMeta { - RumHardcodedRetentionFilterMeta { - source: None, - updated_at: None, - updated_by_handle: None, - additional_properties: std::collections::BTreeMap::new(), - _unparsed: false, - } - } - - pub fn source( - mut self, - value: crate::datadogV2::model::RumHardcodedRetentionFilterMetaSource, - ) -> Self { - self.source = Some(value); - self - } - - pub fn updated_at(mut self, value: i64) -> Self { - self.updated_at = Some(value); - self - } - - pub fn updated_by_handle(mut self, value: String) -> Self { - self.updated_by_handle = Some(value); - self - } - - pub fn additional_properties( - mut self, - value: std::collections::BTreeMap, - ) -> Self { - self.additional_properties = value; - self - } -} - -impl Default for RumHardcodedRetentionFilterMeta { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterMeta { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct RumHardcodedRetentionFilterMetaVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterMetaVisitor { - type Value = RumHardcodedRetentionFilterMeta; - - fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { - f.write_str("a mapping") - } - - fn visit_map(self, mut map: M) -> Result - where - M: MapAccess<'a>, - { - let mut source: Option< - crate::datadogV2::model::RumHardcodedRetentionFilterMetaSource, - > = None; - let mut updated_at: Option = None; - let mut updated_by_handle: Option = None; - let mut additional_properties: std::collections::BTreeMap< - String, - serde_json::Value, - > = std::collections::BTreeMap::new(); - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "source" => { - if v.is_null() { - continue; - } - source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _source) = source { - match _source { - crate::datadogV2::model::RumHardcodedRetentionFilterMetaSource::UnparsedObject(_source) => { - _unparsed = true; - }, - _ => {} - } - } - } - "updated_at" => { - if v.is_null() { - continue; - } - updated_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "updated_by_handle" => { - if v.is_null() { - continue; - } - updated_by_handle = - 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); - } - } - } - } - - let content = RumHardcodedRetentionFilterMeta { - source, - updated_at, - updated_by_handle, - additional_properties, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(RumHardcodedRetentionFilterMetaVisitor) - } -} diff --git a/src/datadogV2/model/model_rum_hardcoded_retention_filter_response.rs b/src/datadogV2/model/model_run_data_observability_monitor_response.rs similarity index 65% rename from src/datadogV2/model/model_rum_hardcoded_retention_filter_response.rs rename to src/datadogV2/model/model_run_data_observability_monitor_response.rs index 98d3180edf..fd50fd5c86 100644 --- a/src/datadogV2/model/model_rum_hardcoded_retention_filter_response.rs +++ b/src/datadogV2/model/model_run_data_observability_monitor_response.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// A hardcoded retention filter response body. +/// The response returned when a data observability monitor run is triggered. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct RumHardcodedRetentionFilterResponse { - /// A hardcoded retention filter. +pub struct RunDataObservabilityMonitorResponse { + /// The data object returned when a data observability monitor run is triggered. #[serde(rename = "data")] - pub data: Option, + pub data: crate::datadogV2::model::RunDataObservabilityMonitorResponseData, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,20 +21,17 @@ pub struct RumHardcodedRetentionFilterResponse { pub(crate) _unparsed: bool, } -impl RumHardcodedRetentionFilterResponse { - pub fn new() -> RumHardcodedRetentionFilterResponse { - RumHardcodedRetentionFilterResponse { - data: None, +impl RunDataObservabilityMonitorResponse { + pub fn new( + data: crate::datadogV2::model::RunDataObservabilityMonitorResponseData, + ) -> RunDataObservabilityMonitorResponse { + RunDataObservabilityMonitorResponse { + data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } } - pub fn data(mut self, value: crate::datadogV2::model::RumHardcodedRetentionFilterData) -> Self { - self.data = Some(value); - self - } - pub fn additional_properties( mut self, value: std::collections::BTreeMap, @@ -44,20 +41,14 @@ impl RumHardcodedRetentionFilterResponse { } } -impl Default for RumHardcodedRetentionFilterResponse { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterResponse { +impl<'de> Deserialize<'de> for RunDataObservabilityMonitorResponse { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct RumHardcodedRetentionFilterResponseVisitor; - impl<'a> Visitor<'a> for RumHardcodedRetentionFilterResponseVisitor { - type Value = RumHardcodedRetentionFilterResponse; + struct RunDataObservabilityMonitorResponseVisitor; + impl<'a> Visitor<'a> for RunDataObservabilityMonitorResponseVisitor { + type Value = RunDataObservabilityMonitorResponse; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -67,8 +58,9 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterResponse { where M: MapAccess<'a>, { - let mut data: Option = - None; + let mut data: Option< + crate::datadogV2::model::RunDataObservabilityMonitorResponseData, + > = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -78,9 +70,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterResponse { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { "data" => { - if v.is_null() { - continue; - } data = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { @@ -90,8 +79,9 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterResponse { } } } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = RumHardcodedRetentionFilterResponse { + let content = RunDataObservabilityMonitorResponse { data, additional_properties, _unparsed, @@ -101,6 +91,6 @@ impl<'de> Deserialize<'de> for RumHardcodedRetentionFilterResponse { } } - deserializer.deserialize_any(RumHardcodedRetentionFilterResponseVisitor) + deserializer.deserialize_any(RunDataObservabilityMonitorResponseVisitor) } } diff --git a/src/datadogV2/model/model_run_data_observability_monitor_response_data.rs b/src/datadogV2/model/model_run_data_observability_monitor_response_data.rs new file mode 100644 index 0000000000..64a2ddccf0 --- /dev/null +++ b/src/datadogV2/model/model_run_data_observability_monitor_response_data.rs @@ -0,0 +1,114 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The data object returned when a data observability monitor run is triggered. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct RunDataObservabilityMonitorResponseData { + /// The unique identifier of the monitor run. + #[serde(rename = "id")] + pub id: String, + /// The JSON:API resource type for a data observability monitor run. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::DataObservabilityMonitorRunType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl RunDataObservabilityMonitorResponseData { + pub fn new( + id: String, + type_: crate::datadogV2::model::DataObservabilityMonitorRunType, + ) -> RunDataObservabilityMonitorResponseData { + RunDataObservabilityMonitorResponseData { + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for RunDataObservabilityMonitorResponseData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct RunDataObservabilityMonitorResponseDataVisitor; + impl<'a> Visitor<'a> for RunDataObservabilityMonitorResponseDataVisitor { + type Value = RunDataObservabilityMonitorResponseData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut id: Option = None; + let mut type_: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::DataObservabilityMonitorRunType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = RunDataObservabilityMonitorResponseData { + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(RunDataObservabilityMonitorResponseDataVisitor) + } +} diff --git a/src/datadogV2/model/model_slack_user_binding_data.rs b/src/datadogV2/model/model_slack_user_binding_data.rs new file mode 100644 index 0000000000..b18e2f44e5 --- /dev/null +++ b/src/datadogV2/model/model_slack_user_binding_data.rs @@ -0,0 +1,130 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Slack team ID data from a response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct SlackUserBindingData { + /// The Slack team ID. + #[serde(rename = "id")] + pub id: Option, + /// Slack user binding resource type. + #[serde(rename = "type")] + pub type_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl SlackUserBindingData { + pub fn new() -> SlackUserBindingData { + SlackUserBindingData { + id: None, + type_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_(mut self, value: crate::datadogV2::model::SlackUserBindingType) -> Self { + self.type_ = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for SlackUserBindingData { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for SlackUserBindingData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct SlackUserBindingDataVisitor; + impl<'a> Visitor<'a> for SlackUserBindingDataVisitor { + type Value = SlackUserBindingData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "id" => { + if v.is_null() { + continue; + } + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + if v.is_null() { + continue; + } + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::SlackUserBindingType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = SlackUserBindingData { + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(SlackUserBindingDataVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_service_type.rs b/src/datadogV2/model/model_slack_user_binding_type.rs similarity index 81% rename from src/datadogV2/model/model_incident_service_type.rs rename to src/datadogV2/model/model_slack_user_binding_type.rs index 62f5b70df0..7419dede04 100644 --- a/src/datadogV2/model/model_incident_service_type.rs +++ b/src/datadogV2/model/model_slack_user_binding_type.rs @@ -6,21 +6,21 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[non_exhaustive] #[derive(Clone, Debug, Eq, PartialEq)] -pub enum IncidentServiceType { - SERVICES, +pub enum SlackUserBindingType { + TEAM_ID, UnparsedObject(crate::datadog::UnparsedObject), } -impl ToString for IncidentServiceType { +impl ToString for SlackUserBindingType { fn to_string(&self) -> String { match self { - Self::SERVICES => String::from("services"), + Self::TEAM_ID => String::from("team_id"), Self::UnparsedObject(v) => v.value.to_string(), } } } -impl Serialize for IncidentServiceType { +impl Serialize for SlackUserBindingType { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -32,14 +32,14 @@ impl Serialize for IncidentServiceType { } } -impl<'de> Deserialize<'de> for IncidentServiceType { +impl<'de> Deserialize<'de> for SlackUserBindingType { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { let s: String = String::deserialize(deserializer)?; Ok(match s.as_str() { - "services" => Self::SERVICES, + "team_id" => Self::TEAM_ID, _ => Self::UnparsedObject(crate::datadog::UnparsedObject { value: serde_json::Value::String(s.into()), }), diff --git a/src/datadogV2/model/model_incident_service_update_request.rs b/src/datadogV2/model/model_slack_user_bindings_response.rs similarity index 74% rename from src/datadogV2/model/model_incident_service_update_request.rs rename to src/datadogV2/model/model_slack_user_bindings_response.rs index 5e4c5e58ae..f0a49954ec 100644 --- a/src/datadogV2/model/model_incident_service_update_request.rs +++ b/src/datadogV2/model/model_slack_user_bindings_response.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Update request with an incident service payload. +/// Response with a list of Slack user bindings. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceUpdateRequest { - /// Incident Service payload for update requests. +pub struct SlackUserBindingsResponse { + /// An array of Slack user bindings. #[serde(rename = "data")] - pub data: crate::datadogV2::model::IncidentServiceUpdateData, + pub data: Vec, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,11 +21,11 @@ pub struct IncidentServiceUpdateRequest { pub(crate) _unparsed: bool, } -impl IncidentServiceUpdateRequest { +impl SlackUserBindingsResponse { pub fn new( - data: crate::datadogV2::model::IncidentServiceUpdateData, - ) -> IncidentServiceUpdateRequest { - IncidentServiceUpdateRequest { + data: Vec, + ) -> SlackUserBindingsResponse { + SlackUserBindingsResponse { data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -41,14 +41,14 @@ impl IncidentServiceUpdateRequest { } } -impl<'de> Deserialize<'de> for IncidentServiceUpdateRequest { +impl<'de> Deserialize<'de> for SlackUserBindingsResponse { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceUpdateRequestVisitor; - impl<'a> Visitor<'a> for IncidentServiceUpdateRequestVisitor { - type Value = IncidentServiceUpdateRequest; + struct SlackUserBindingsResponseVisitor; + impl<'a> Visitor<'a> for SlackUserBindingsResponseVisitor { + type Value = SlackUserBindingsResponse; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -58,7 +58,7 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateRequest { where M: MapAccess<'a>, { - let mut data: Option = None; + let mut data: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -79,7 +79,7 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateRequest { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = IncidentServiceUpdateRequest { + let content = SlackUserBindingsResponse { data, additional_properties, _unparsed, @@ -89,6 +89,6 @@ impl<'de> Deserialize<'de> for IncidentServiceUpdateRequest { } } - deserializer.deserialize_any(IncidentServiceUpdateRequestVisitor) + deserializer.deserialize_any(SlackUserBindingsResponseVisitor) } } diff --git a/src/datadogV2/model/model_incident_service_response.rs b/src/datadogV2/model/model_tag_policies_list_response.rs similarity index 70% rename from src/datadogV2/model/model_incident_service_response.rs rename to src/datadogV2/model/model_tag_policies_list_response.rs index c1dcfb5fcf..6c854cbae1 100644 --- a/src/datadogV2/model/model_incident_service_response.rs +++ b/src/datadogV2/model/model_tag_policies_list_response.rs @@ -6,17 +6,17 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Response with an incident service payload. +/// A page of tag policies. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceResponse { - /// Incident Service data from responses. +pub struct TagPoliciesListResponse { + /// An array of tag policy data objects. #[serde(rename = "data")] - pub data: crate::datadogV2::model::IncidentServiceResponseData, - /// Included objects from relationships. + pub data: Vec, + /// Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. #[serde(rename = "included")] - pub included: Option>, + pub included: Option>, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -24,11 +24,9 @@ pub struct IncidentServiceResponse { pub(crate) _unparsed: bool, } -impl IncidentServiceResponse { - pub fn new( - data: crate::datadogV2::model::IncidentServiceResponseData, - ) -> IncidentServiceResponse { - IncidentServiceResponse { +impl TagPoliciesListResponse { + pub fn new(data: Vec) -> TagPoliciesListResponse { + TagPoliciesListResponse { data, included: None, additional_properties: std::collections::BTreeMap::new(), @@ -36,10 +34,7 @@ impl IncidentServiceResponse { } } - pub fn included( - mut self, - value: Vec, - ) -> Self { + pub fn included(mut self, value: Vec) -> Self { self.included = Some(value); self } @@ -53,14 +48,14 @@ impl IncidentServiceResponse { } } -impl<'de> Deserialize<'de> for IncidentServiceResponse { +impl<'de> Deserialize<'de> for TagPoliciesListResponse { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceResponseVisitor; - impl<'a> Visitor<'a> for IncidentServiceResponseVisitor { - type Value = IncidentServiceResponse; + struct TagPoliciesListResponseVisitor; + impl<'a> Visitor<'a> for TagPoliciesListResponseVisitor { + type Value = TagPoliciesListResponse; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -70,10 +65,8 @@ impl<'de> Deserialize<'de> for IncidentServiceResponse { where M: MapAccess<'a>, { - let mut data: Option = None; - let mut included: Option< - Vec, - > = None; + let mut data: Option> = None; + let mut included: Option> = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -100,7 +93,7 @@ impl<'de> Deserialize<'de> for IncidentServiceResponse { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = IncidentServiceResponse { + let content = TagPoliciesListResponse { data, included, additional_properties, @@ -111,6 +104,6 @@ impl<'de> Deserialize<'de> for IncidentServiceResponse { } } - deserializer.deserialize_any(IncidentServiceResponseVisitor) + deserializer.deserialize_any(TagPoliciesListResponseVisitor) } } diff --git a/src/datadogV2/model/model_tag_policy_attributes.rs b/src/datadogV2/model/model_tag_policy_attributes.rs new file mode 100644 index 0000000000..ee53a5e1be --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_attributes.rs @@ -0,0 +1,304 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// The attributes of a tag policy resource. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyAttributes { + /// The RFC 3339 timestamp at which the policy was created. + #[serde(rename = "created_at")] + pub created_at: chrono::DateTime, + /// The identifier of the user who created the policy. + #[serde(rename = "created_by")] + pub created_by: String, + /// The RFC 3339 timestamp at which the policy was soft-deleted. `null` if the policy has not been deleted. Only present when `include_deleted=true` is requested. + #[serde( + rename = "deleted_at", + default, + with = "::serde_with::rust::double_option" + )] + pub deleted_at: Option>>, + /// The identifier of the user who soft-deleted the policy. `null` if the policy has not been deleted. + #[serde( + rename = "deleted_by", + default, + with = "::serde_with::rust::double_option" + )] + pub deleted_by: Option>, + /// Whether the policy is currently enforced. + #[serde(rename = "enabled")] + pub enabled: bool, + /// The RFC 3339 timestamp at which the policy was last modified. + #[serde(rename = "modified_at")] + pub modified_at: chrono::DateTime, + /// The identifier of the user who last modified the policy. + #[serde(rename = "modified_by")] + pub modified_by: String, + /// When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + #[serde(rename = "negated")] + pub negated: bool, + /// Human-readable name for the tag policy. + #[serde(rename = "policy_name")] + pub policy_name: String, + /// How the policy is enforced. `blocking` rejects telemetry that violates the policy. + /// `surfacing` only highlights non-compliant telemetry without blocking it. + #[serde(rename = "policy_type")] + pub policy_type: crate::datadogV2::model::TagPolicyType, + /// When `true`, telemetry without this tag is treated as a violation. + #[serde(rename = "required")] + pub required: bool, + /// The scope the policy applies within. + #[serde(rename = "scope")] + pub scope: String, + /// The telemetry source that a tag policy applies to. + #[serde(rename = "source")] + pub source: crate::datadogV2::model::TagPolicySource, + /// The tag key that the policy governs. + #[serde(rename = "tag_key")] + pub tag_key: String, + /// The patterns that valid values for the tag key must match. + #[serde(rename = "tag_value_patterns")] + pub tag_value_patterns: Vec, + /// A monotonically increasing version counter that is incremented on each update. + #[serde(rename = "version")] + pub version: i64, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyAttributes { + pub fn new( + created_at: chrono::DateTime, + created_by: String, + enabled: bool, + modified_at: chrono::DateTime, + modified_by: String, + negated: bool, + policy_name: String, + policy_type: crate::datadogV2::model::TagPolicyType, + required: bool, + scope: String, + source: crate::datadogV2::model::TagPolicySource, + tag_key: String, + tag_value_patterns: Vec, + version: i64, + ) -> TagPolicyAttributes { + TagPolicyAttributes { + created_at, + created_by, + deleted_at: None, + deleted_by: None, + enabled, + modified_at, + modified_by, + negated, + policy_name, + policy_type, + required, + scope, + source, + tag_key, + tag_value_patterns, + version, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn deleted_at(mut self, value: Option>) -> Self { + self.deleted_at = Some(value); + self + } + + pub fn deleted_by(mut self, value: Option) -> Self { + self.deleted_by = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyAttributesVisitor; + impl<'a> Visitor<'a> for TagPolicyAttributesVisitor { + type Value = TagPolicyAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut created_at: Option> = None; + let mut created_by: Option = None; + let mut deleted_at: Option>> = None; + let mut deleted_by: Option> = None; + let mut enabled: Option = None; + let mut modified_at: Option> = None; + let mut modified_by: Option = None; + let mut negated: Option = None; + let mut policy_name: Option = None; + let mut policy_type: Option = None; + let mut required: Option = None; + let mut scope: Option = None; + let mut source: Option = None; + let mut tag_key: Option = None; + let mut tag_value_patterns: Option> = None; + let mut version: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "created_at" => { + created_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "created_by" => { + created_by = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "deleted_at" => { + deleted_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "deleted_by" => { + deleted_by = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "enabled" => { + enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "modified_at" => { + modified_at = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "modified_by" => { + modified_by = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "negated" => { + negated = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_name" => { + policy_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_type" => { + policy_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _policy_type) = policy_type { + match _policy_type { + crate::datadogV2::model::TagPolicyType::UnparsedObject( + _policy_type, + ) => { + _unparsed = true; + } + _ => {} + } + } + } + "required" => { + required = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "source" => { + source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _source) = source { + match _source { + crate::datadogV2::model::TagPolicySource::UnparsedObject( + _source, + ) => { + _unparsed = true; + } + _ => {} + } + } + } + "tag_key" => { + tag_key = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tag_value_patterns" => { + tag_value_patterns = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "version" => { + version = 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); + } + } + } + } + let created_at = created_at.ok_or_else(|| M::Error::missing_field("created_at"))?; + let created_by = created_by.ok_or_else(|| M::Error::missing_field("created_by"))?; + let enabled = enabled.ok_or_else(|| M::Error::missing_field("enabled"))?; + let modified_at = + modified_at.ok_or_else(|| M::Error::missing_field("modified_at"))?; + let modified_by = + modified_by.ok_or_else(|| M::Error::missing_field("modified_by"))?; + let negated = negated.ok_or_else(|| M::Error::missing_field("negated"))?; + let policy_name = + policy_name.ok_or_else(|| M::Error::missing_field("policy_name"))?; + let policy_type = + policy_type.ok_or_else(|| M::Error::missing_field("policy_type"))?; + let required = required.ok_or_else(|| M::Error::missing_field("required"))?; + let scope = scope.ok_or_else(|| M::Error::missing_field("scope"))?; + let source = source.ok_or_else(|| M::Error::missing_field("source"))?; + let tag_key = tag_key.ok_or_else(|| M::Error::missing_field("tag_key"))?; + let tag_value_patterns = tag_value_patterns + .ok_or_else(|| M::Error::missing_field("tag_value_patterns"))?; + let version = version.ok_or_else(|| M::Error::missing_field("version"))?; + + let content = TagPolicyAttributes { + created_at, + created_by, + deleted_at, + deleted_by, + enabled, + modified_at, + modified_by, + negated, + policy_name, + policy_type, + required, + scope, + source, + tag_key, + tag_value_patterns, + version, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_create_attributes.rs b/src/datadogV2/model/model_tag_policy_create_attributes.rs new file mode 100644 index 0000000000..e1798b0fb7 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_create_attributes.rs @@ -0,0 +1,227 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes that can be supplied when creating a tag policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyCreateAttributes { + /// Whether the policy is currently enforced. Defaults to `true` for newly created policies. + #[serde(rename = "enabled")] + pub enabled: Option, + /// When `true`, the policy matches tag values that do NOT match any of the supplied patterns. Defaults to `false`. + #[serde(rename = "negated")] + pub negated: Option, + /// Human-readable name for the tag policy. + #[serde(rename = "policy_name")] + pub policy_name: String, + /// The policy type allowed when creating a tag policy. Only `surfacing` is accepted at + /// creation time. + #[serde(rename = "policy_type")] + pub policy_type: crate::datadogV2::model::TagPolicyCreateType, + /// When `true`, telemetry without this tag is treated as a violation. Defaults to `false`. + #[serde(rename = "required")] + pub required: Option, + /// The scope the policy applies within. Typically an environment, team, or + /// organization-level identifier used to limit where the policy is enforced. + #[serde(rename = "scope")] + pub scope: String, + /// The telemetry source that a tag policy applies to. + #[serde(rename = "source")] + pub source: crate::datadogV2::model::TagPolicySource, + /// The tag key that the policy governs (for example, `service`). + #[serde(rename = "tag_key")] + pub tag_key: String, + /// One or more patterns that valid values for the tag key must match. At least one + /// pattern is required. + #[serde(rename = "tag_value_patterns")] + pub tag_value_patterns: Vec, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyCreateAttributes { + pub fn new( + policy_name: String, + policy_type: crate::datadogV2::model::TagPolicyCreateType, + scope: String, + source: crate::datadogV2::model::TagPolicySource, + tag_key: String, + tag_value_patterns: Vec, + ) -> TagPolicyCreateAttributes { + TagPolicyCreateAttributes { + enabled: None, + negated: None, + policy_name, + policy_type, + required: None, + scope, + source, + tag_key, + tag_value_patterns, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn enabled(mut self, value: bool) -> Self { + self.enabled = Some(value); + self + } + + pub fn negated(mut self, value: bool) -> Self { + self.negated = Some(value); + self + } + + pub fn required(mut self, value: bool) -> Self { + self.required = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyCreateAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyCreateAttributesVisitor; + impl<'a> Visitor<'a> for TagPolicyCreateAttributesVisitor { + type Value = TagPolicyCreateAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut enabled: Option = None; + let mut negated: Option = None; + let mut policy_name: Option = None; + let mut policy_type: Option = None; + let mut required: Option = None; + let mut scope: Option = None; + let mut source: Option = None; + let mut tag_key: Option = None; + let mut tag_value_patterns: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "enabled" => { + if v.is_null() { + continue; + } + enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "negated" => { + if v.is_null() { + continue; + } + negated = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_name" => { + policy_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_type" => { + policy_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _policy_type) = policy_type { + match _policy_type { + crate::datadogV2::model::TagPolicyCreateType::UnparsedObject(_policy_type) => { + _unparsed = true; + }, + _ => {} + } + } + } + "required" => { + if v.is_null() { + continue; + } + required = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "source" => { + source = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _source) = source { + match _source { + crate::datadogV2::model::TagPolicySource::UnparsedObject( + _source, + ) => { + _unparsed = true; + } + _ => {} + } + } + } + "tag_key" => { + tag_key = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tag_value_patterns" => { + tag_value_patterns = + 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); + } + } + } + } + let policy_name = + policy_name.ok_or_else(|| M::Error::missing_field("policy_name"))?; + let policy_type = + policy_type.ok_or_else(|| M::Error::missing_field("policy_type"))?; + let scope = scope.ok_or_else(|| M::Error::missing_field("scope"))?; + let source = source.ok_or_else(|| M::Error::missing_field("source"))?; + let tag_key = tag_key.ok_or_else(|| M::Error::missing_field("tag_key"))?; + let tag_value_patterns = tag_value_patterns + .ok_or_else(|| M::Error::missing_field("tag_value_patterns"))?; + + let content = TagPolicyCreateAttributes { + enabled, + negated, + policy_name, + policy_type, + required, + scope, + source, + tag_key, + tag_value_patterns, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyCreateAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_create_data.rs b/src/datadogV2/model/model_tag_policy_create_data.rs new file mode 100644 index 0000000000..99287a2b84 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_create_data.rs @@ -0,0 +1,114 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object for creating a tag policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyCreateData { + /// Attributes that can be supplied when creating a tag policy. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::TagPolicyCreateAttributes, + /// JSON:API resource type for a tag policy. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::TagPolicyResourceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyCreateData { + pub fn new( + attributes: crate::datadogV2::model::TagPolicyCreateAttributes, + type_: crate::datadogV2::model::TagPolicyResourceType, + ) -> TagPolicyCreateData { + TagPolicyCreateData { + attributes, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyCreateData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyCreateDataVisitor; + impl<'a> Visitor<'a> for TagPolicyCreateDataVisitor { + type Value = TagPolicyCreateData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option = + None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::TagPolicyResourceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = TagPolicyCreateData { + attributes, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyCreateDataVisitor) + } +} diff --git a/src/datadogV2/model/model_incident_service_create_request.rs b/src/datadogV2/model/model_tag_policy_create_request.rs similarity index 73% rename from src/datadogV2/model/model_incident_service_create_request.rs rename to src/datadogV2/model/model_tag_policy_create_request.rs index bc830585f7..ab8c74603f 100644 --- a/src/datadogV2/model/model_incident_service_create_request.rs +++ b/src/datadogV2/model/model_tag_policy_create_request.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Create request with an incident service payload. +/// Payload for creating a new tag policy. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceCreateRequest { - /// Incident Service payload for create requests. +pub struct TagPolicyCreateRequest { + /// Data object for creating a tag policy. #[serde(rename = "data")] - pub data: crate::datadogV2::model::IncidentServiceCreateData, + pub data: crate::datadogV2::model::TagPolicyCreateData, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,11 +21,9 @@ pub struct IncidentServiceCreateRequest { pub(crate) _unparsed: bool, } -impl IncidentServiceCreateRequest { - pub fn new( - data: crate::datadogV2::model::IncidentServiceCreateData, - ) -> IncidentServiceCreateRequest { - IncidentServiceCreateRequest { +impl TagPolicyCreateRequest { + pub fn new(data: crate::datadogV2::model::TagPolicyCreateData) -> TagPolicyCreateRequest { + TagPolicyCreateRequest { data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, @@ -41,14 +39,14 @@ impl IncidentServiceCreateRequest { } } -impl<'de> Deserialize<'de> for IncidentServiceCreateRequest { +impl<'de> Deserialize<'de> for TagPolicyCreateRequest { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceCreateRequestVisitor; - impl<'a> Visitor<'a> for IncidentServiceCreateRequestVisitor { - type Value = IncidentServiceCreateRequest; + struct TagPolicyCreateRequestVisitor; + impl<'a> Visitor<'a> for TagPolicyCreateRequestVisitor { + type Value = TagPolicyCreateRequest; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -58,7 +56,7 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateRequest { where M: MapAccess<'a>, { - let mut data: Option = None; + let mut data: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -79,7 +77,7 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateRequest { } let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = IncidentServiceCreateRequest { + let content = TagPolicyCreateRequest { data, additional_properties, _unparsed, @@ -89,6 +87,6 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateRequest { } } - deserializer.deserialize_any(IncidentServiceCreateRequestVisitor) + deserializer.deserialize_any(TagPolicyCreateRequestVisitor) } } diff --git a/src/datadogV2/model/model_tag_policy_create_type.rs b/src/datadogV2/model/model_tag_policy_create_type.rs new file mode 100644 index 0000000000..ede00be227 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_create_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicyCreateType { + SURFACING, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicyCreateType { + fn to_string(&self) -> String { + match self { + Self::SURFACING => String::from("surfacing"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicyCreateType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicyCreateType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "surfacing" => Self::SURFACING, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_incident_service_response_data.rs b/src/datadogV2/model/model_tag_policy_data.rs similarity index 66% rename from src/datadogV2/model/model_incident_service_response_data.rs rename to src/datadogV2/model/model_tag_policy_data.rs index 137dda5654..ef56ef91e0 100644 --- a/src/datadogV2/model/model_incident_service_response_data.rs +++ b/src/datadogV2/model/model_tag_policy_data.rs @@ -6,23 +6,23 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// Incident Service data from responses. +/// A tag policy resource. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceResponseData { - /// The incident service's attributes from a response. +pub struct TagPolicyData { + /// The attributes of a tag policy resource. #[serde(rename = "attributes")] - pub attributes: Option, - /// The incident service's ID. + pub attributes: crate::datadogV2::model::TagPolicyAttributes, + /// The unique identifier of the tag policy. #[serde(rename = "id")] pub id: String, - /// The incident service's relationships. + /// Related resources for a tag policy. Only present when the corresponding `include` query parameter is supplied. #[serde(rename = "relationships")] - pub relationships: Option, - /// Incident service resource type. + pub relationships: Option, + /// JSON:API resource type for a tag policy. #[serde(rename = "type")] - pub type_: crate::datadogV2::model::IncidentServiceType, + pub type_: crate::datadogV2::model::TagPolicyResourceType, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -30,13 +30,14 @@ pub struct IncidentServiceResponseData { pub(crate) _unparsed: bool, } -impl IncidentServiceResponseData { +impl TagPolicyData { pub fn new( + attributes: crate::datadogV2::model::TagPolicyAttributes, id: String, - type_: crate::datadogV2::model::IncidentServiceType, - ) -> IncidentServiceResponseData { - IncidentServiceResponseData { - attributes: None, + type_: crate::datadogV2::model::TagPolicyResourceType, + ) -> TagPolicyData { + TagPolicyData { + attributes, id, relationships: None, type_, @@ -45,18 +46,7 @@ impl IncidentServiceResponseData { } } - pub fn attributes( - mut self, - value: crate::datadogV2::model::IncidentServiceResponseAttributes, - ) -> Self { - self.attributes = Some(value); - self - } - - pub fn relationships( - mut self, - value: crate::datadogV2::model::IncidentServiceRelationships, - ) -> Self { + pub fn relationships(mut self, value: crate::datadogV2::model::TagPolicyRelationships) -> Self { self.relationships = Some(value); self } @@ -70,14 +60,14 @@ impl IncidentServiceResponseData { } } -impl<'de> Deserialize<'de> for IncidentServiceResponseData { +impl<'de> Deserialize<'de> for TagPolicyData { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceResponseDataVisitor; - impl<'a> Visitor<'a> for IncidentServiceResponseDataVisitor { - type Value = IncidentServiceResponseData; + struct TagPolicyDataVisitor; + impl<'a> Visitor<'a> for TagPolicyDataVisitor { + type Value = TagPolicyData; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -87,14 +77,11 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseData { where M: MapAccess<'a>, { - let mut attributes: Option< - crate::datadogV2::model::IncidentServiceResponseAttributes, - > = None; + let mut attributes: Option = None; let mut id: Option = None; - let mut relationships: Option< - crate::datadogV2::model::IncidentServiceRelationships, - > = None; - let mut type_: Option = None; + let mut relationships: Option = + None; + let mut type_: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -104,9 +91,6 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseData { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { "attributes" => { - if v.is_null() { - continue; - } attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } "id" => { @@ -123,7 +107,7 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseData { type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); if let Some(ref _type_) = type_ { match _type_ { - crate::datadogV2::model::IncidentServiceType::UnparsedObject(_type_) => { + crate::datadogV2::model::TagPolicyResourceType::UnparsedObject(_type_) => { _unparsed = true; }, _ => {} @@ -137,10 +121,11 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseData { } } } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; let id = id.ok_or_else(|| M::Error::missing_field("id"))?; let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; - let content = IncidentServiceResponseData { + let content = TagPolicyData { attributes, id, relationships, @@ -153,6 +138,6 @@ impl<'de> Deserialize<'de> for IncidentServiceResponseData { } } - deserializer.deserialize_any(IncidentServiceResponseDataVisitor) + deserializer.deserialize_any(TagPolicyDataVisitor) } } diff --git a/src/datadogV2/model/model_tag_policy_include.rs b/src/datadogV2/model/model_tag_policy_include.rs new file mode 100644 index 0000000000..95e68232ea --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_include.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicyInclude { + SCORE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicyInclude { + fn to_string(&self) -> String { + match self { + Self::SCORE => String::from("score"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicyInclude { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicyInclude { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "score" => Self::SCORE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_tag_policy_relationships.rs b/src/datadogV2/model/model_tag_policy_relationships.rs new file mode 100644 index 0000000000..cedefb7950 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_relationships.rs @@ -0,0 +1,105 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Related resources for a tag policy. Only present when the corresponding `include` query parameter is supplied. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyRelationships { + /// A relationship to the compliance score resource for this policy. + #[serde(rename = "score")] + pub score: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyRelationships { + pub fn new() -> TagPolicyRelationships { + TagPolicyRelationships { + score: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn score(mut self, value: crate::datadogV2::model::TagPolicyScoreRelationship) -> Self { + self.score = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for TagPolicyRelationships { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for TagPolicyRelationships { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyRelationshipsVisitor; + impl<'a> Visitor<'a> for TagPolicyRelationshipsVisitor { + type Value = TagPolicyRelationships; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut score: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "score" => { + if v.is_null() { + continue; + } + score = 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); + } + } + } + } + + let content = TagPolicyRelationships { + score, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyRelationshipsVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_resource_type.rs b/src/datadogV2/model/model_tag_policy_resource_type.rs new file mode 100644 index 0000000000..6d31acb4e9 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_resource_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicyResourceType { + TAG_POLICY, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicyResourceType { + fn to_string(&self) -> String { + match self { + Self::TAG_POLICY => String::from("tag_policy"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicyResourceType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicyResourceType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "tag_policy" => Self::TAG_POLICY, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_tag_policy_response.rs b/src/datadogV2/model/model_tag_policy_response.rs new file mode 100644 index 0000000000..78e07780dc --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_response.rs @@ -0,0 +1,109 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A single tag policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyResponse { + /// A tag policy resource. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::TagPolicyData, + /// Related resources fetched alongside the primary tag policies. Populated when an `include` query parameter is supplied. + #[serde(rename = "included")] + pub included: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyResponse { + pub fn new(data: crate::datadogV2::model::TagPolicyData) -> TagPolicyResponse { + TagPolicyResponse { + data, + included: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn included(mut self, value: Vec) -> Self { + self.included = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyResponseVisitor; + impl<'a> Visitor<'a> for TagPolicyResponseVisitor { + type Value = TagPolicyResponse; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut included: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "included" => { + if v.is_null() { + continue; + } + included = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = TagPolicyResponse { + data, + included, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_score_attributes.rs b/src/datadogV2/model/model_tag_policy_score_attributes.rs new file mode 100644 index 0000000000..b420d3051d --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_score_attributes.rs @@ -0,0 +1,132 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Attributes of a tag policy compliance score. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyScoreAttributes { + /// The compliance score for the policy over the requested time window, as a percentage + /// between 0 and 100. `null` indicates that no relevant telemetry was found. + #[serialize_always] + #[serde(rename = "score")] + pub score: Option, + /// End of the time window the score was computed over, as a Unix timestamp in milliseconds. + #[serde(rename = "ts_end")] + pub ts_end: i64, + /// Start of the time window the score was computed over, as a Unix timestamp in milliseconds. + #[serde(rename = "ts_start")] + pub ts_start: i64, + /// The version of the tag policy that the score was computed against. + #[serde(rename = "version")] + pub version: i64, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyScoreAttributes { + pub fn new( + score: Option, + ts_end: i64, + ts_start: i64, + version: i64, + ) -> TagPolicyScoreAttributes { + TagPolicyScoreAttributes { + score, + ts_end, + ts_start, + version, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyScoreAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyScoreAttributesVisitor; + impl<'a> Visitor<'a> for TagPolicyScoreAttributesVisitor { + type Value = TagPolicyScoreAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut score: Option> = None; + let mut ts_end: Option = None; + let mut ts_start: Option = None; + let mut version: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "score" => { + if v.as_str() == Some("") { + continue; + } + score = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "ts_end" => { + ts_end = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "ts_start" => { + ts_start = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "version" => { + version = 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); + } + } + } + } + let score = score.ok_or_else(|| M::Error::missing_field("score"))?; + let ts_end = ts_end.ok_or_else(|| M::Error::missing_field("ts_end"))?; + let ts_start = ts_start.ok_or_else(|| M::Error::missing_field("ts_start"))?; + let version = version.ok_or_else(|| M::Error::missing_field("version"))?; + + let content = TagPolicyScoreAttributes { + score, + ts_end, + ts_start, + version, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyScoreAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_score_data.rs b/src/datadogV2/model/model_tag_policy_score_data.rs new file mode 100644 index 0000000000..f4d2f0ed87 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_score_data.rs @@ -0,0 +1,125 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A compliance score resource for a tag policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyScoreData { + /// Attributes of a tag policy compliance score. + #[serde(rename = "attributes")] + pub attributes: crate::datadogV2::model::TagPolicyScoreAttributes, + /// The unique identifier of the compliance score resource. + #[serde(rename = "id")] + pub id: String, + /// JSON:API resource type for a tag policy compliance score. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::TagPolicyScoreResourceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyScoreData { + pub fn new( + attributes: crate::datadogV2::model::TagPolicyScoreAttributes, + id: String, + type_: crate::datadogV2::model::TagPolicyScoreResourceType, + ) -> TagPolicyScoreData { + TagPolicyScoreData { + attributes, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyScoreData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyScoreDataVisitor; + impl<'a> Visitor<'a> for TagPolicyScoreDataVisitor { + type Value = TagPolicyScoreData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option = + None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::TagPolicyScoreResourceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let attributes = attributes.ok_or_else(|| M::Error::missing_field("attributes"))?; + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = TagPolicyScoreData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyScoreDataVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_score_relationship.rs b/src/datadogV2/model/model_tag_policy_score_relationship.rs new file mode 100644 index 0000000000..1e660c6da0 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_score_relationship.rs @@ -0,0 +1,95 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// A relationship to the compliance score resource for this policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyScoreRelationship { + /// Identifier of the related compliance score resource. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::TagPolicyScoreRelationshipData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyScoreRelationship { + pub fn new( + data: crate::datadogV2::model::TagPolicyScoreRelationshipData, + ) -> TagPolicyScoreRelationship { + TagPolicyScoreRelationship { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyScoreRelationship { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyScoreRelationshipVisitor; + impl<'a> Visitor<'a> for TagPolicyScoreRelationshipVisitor { + type Value = TagPolicyScoreRelationship; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = + None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = TagPolicyScoreRelationship { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyScoreRelationshipVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_score_relationship_data.rs b/src/datadogV2/model/model_tag_policy_score_relationship_data.rs new file mode 100644 index 0000000000..6b86bf485c --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_score_relationship_data.rs @@ -0,0 +1,113 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Identifier of the related compliance score resource. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyScoreRelationshipData { + /// The unique identifier of the related compliance score resource. + #[serde(rename = "id")] + pub id: String, + /// JSON:API resource type for a tag policy compliance score. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::TagPolicyScoreResourceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyScoreRelationshipData { + pub fn new( + id: String, + type_: crate::datadogV2::model::TagPolicyScoreResourceType, + ) -> TagPolicyScoreRelationshipData { + TagPolicyScoreRelationshipData { + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyScoreRelationshipData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyScoreRelationshipDataVisitor; + impl<'a> Visitor<'a> for TagPolicyScoreRelationshipDataVisitor { + type Value = TagPolicyScoreRelationshipData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::TagPolicyScoreResourceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = TagPolicyScoreRelationshipData { + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyScoreRelationshipDataVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_score_resource_type.rs b/src/datadogV2/model/model_tag_policy_score_resource_type.rs new file mode 100644 index 0000000000..f71debe6d8 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_score_resource_type.rs @@ -0,0 +1,48 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicyScoreResourceType { + TAG_POLICY_SCORE, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicyScoreResourceType { + fn to_string(&self) -> String { + match self { + Self::TAG_POLICY_SCORE => String::from("tag_policy_score"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicyScoreResourceType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicyScoreResourceType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "tag_policy_score" => Self::TAG_POLICY_SCORE, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_incident_service_create_attributes.rs b/src/datadogV2/model/model_tag_policy_score_response.rs similarity index 68% rename from src/datadogV2/model/model_incident_service_create_attributes.rs rename to src/datadogV2/model/model_tag_policy_score_response.rs index e382dcf303..fce36ff597 100644 --- a/src/datadogV2/model/model_incident_service_create_attributes.rs +++ b/src/datadogV2/model/model_tag_policy_score_response.rs @@ -6,14 +6,14 @@ use serde::{Deserialize, Deserializer, Serialize}; use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; -/// The incident service's attributes for a create request. +/// A tag policy compliance score. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] -pub struct IncidentServiceCreateAttributes { - /// Name of the incident service. - #[serde(rename = "name")] - pub name: String, +pub struct TagPolicyScoreResponse { + /// A compliance score resource for a tag policy. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::TagPolicyScoreData, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -21,10 +21,10 @@ pub struct IncidentServiceCreateAttributes { pub(crate) _unparsed: bool, } -impl IncidentServiceCreateAttributes { - pub fn new(name: String) -> IncidentServiceCreateAttributes { - IncidentServiceCreateAttributes { - name, +impl TagPolicyScoreResponse { + pub fn new(data: crate::datadogV2::model::TagPolicyScoreData) -> TagPolicyScoreResponse { + TagPolicyScoreResponse { + data, additional_properties: std::collections::BTreeMap::new(), _unparsed: false, } @@ -39,14 +39,14 @@ impl IncidentServiceCreateAttributes { } } -impl<'de> Deserialize<'de> for IncidentServiceCreateAttributes { +impl<'de> Deserialize<'de> for TagPolicyScoreResponse { fn deserialize(deserializer: D) -> Result where D: Deserializer<'de>, { - struct IncidentServiceCreateAttributesVisitor; - impl<'a> Visitor<'a> for IncidentServiceCreateAttributesVisitor { - type Value = IncidentServiceCreateAttributes; + struct TagPolicyScoreResponseVisitor; + impl<'a> Visitor<'a> for TagPolicyScoreResponseVisitor { + type Value = TagPolicyScoreResponse; fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { f.write_str("a mapping") @@ -56,7 +56,7 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateAttributes { where M: MapAccess<'a>, { - let mut name: Option = None; + let mut data: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -65,8 +65,8 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateAttributes { while let Some((k, v)) = map.next_entry::()? { match k.as_str() { - "name" => { - name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + "data" => { + data = Some(serde_json::from_value(v).map_err(M::Error::custom)?); } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { @@ -75,10 +75,10 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateAttributes { } } } - let name = name.ok_or_else(|| M::Error::missing_field("name"))?; + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; - let content = IncidentServiceCreateAttributes { - name, + let content = TagPolicyScoreResponse { + data, additional_properties, _unparsed, }; @@ -87,6 +87,6 @@ impl<'de> Deserialize<'de> for IncidentServiceCreateAttributes { } } - deserializer.deserialize_any(IncidentServiceCreateAttributesVisitor) + deserializer.deserialize_any(TagPolicyScoreResponseVisitor) } } diff --git a/src/datadogV2/model/model_tag_policy_source.rs b/src/datadogV2/model/model_tag_policy_source.rs new file mode 100644 index 0000000000..358dca2d03 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_source.rs @@ -0,0 +1,60 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicySource { + LOGS, + SPANS, + METRICS, + RUM, + FEED, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicySource { + fn to_string(&self) -> String { + match self { + Self::LOGS => String::from("logs"), + Self::SPANS => String::from("spans"), + Self::METRICS => String::from("metrics"), + Self::RUM => String::from("rum"), + Self::FEED => String::from("feed"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicySource { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicySource { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "logs" => Self::LOGS, + "spans" => Self::SPANS, + "metrics" => Self::METRICS, + "rum" => Self::RUM, + "feed" => Self::FEED, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_tag_policy_type.rs b/src/datadogV2/model/model_tag_policy_type.rs new file mode 100644 index 0000000000..da4cb2f8b8 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_type.rs @@ -0,0 +1,51 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. + +use serde::{Deserialize, Deserializer, Serialize, Serializer}; + +#[non_exhaustive] +#[derive(Clone, Debug, Eq, PartialEq)] +pub enum TagPolicyType { + BLOCKING, + SURFACING, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for TagPolicyType { + fn to_string(&self) -> String { + match self { + Self::BLOCKING => String::from("blocking"), + Self::SURFACING => String::from("surfacing"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for TagPolicyType { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + match self { + Self::UnparsedObject(v) => v.serialize(serializer), + _ => serializer.serialize_str(self.to_string().as_str()), + } + } +} + +impl<'de> Deserialize<'de> for TagPolicyType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "blocking" => Self::BLOCKING, + "surfacing" => Self::SURFACING, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/src/datadogV2/model/model_tag_policy_update_attributes.rs b/src/datadogV2/model/model_tag_policy_update_attributes.rs new file mode 100644 index 0000000000..02cf8aeb30 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_update_attributes.rs @@ -0,0 +1,239 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its +/// current value unchanged. The `source` of a policy cannot be changed. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyUpdateAttributes { + /// Whether the policy is currently enforced. + #[serde(rename = "enabled")] + pub enabled: Option, + /// When `true`, the policy matches tag values that do NOT match any of the supplied patterns. + #[serde(rename = "negated")] + pub negated: Option, + /// Human-readable name for the tag policy. + #[serde(rename = "policy_name")] + pub policy_name: Option, + /// How the policy is enforced. `blocking` rejects telemetry that violates the policy. + /// `surfacing` only highlights non-compliant telemetry without blocking it. + #[serde(rename = "policy_type")] + pub policy_type: Option, + /// When `true`, telemetry without this tag is treated as a violation. + #[serde(rename = "required")] + pub required: Option, + /// The scope the policy applies within. + #[serde(rename = "scope")] + pub scope: Option, + /// The tag key that the policy governs. + #[serde(rename = "tag_key")] + pub tag_key: Option, + /// One or more patterns that valid values for the tag key must match. + #[serde(rename = "tag_value_patterns")] + pub tag_value_patterns: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyUpdateAttributes { + pub fn new() -> TagPolicyUpdateAttributes { + TagPolicyUpdateAttributes { + enabled: None, + negated: None, + policy_name: None, + policy_type: None, + required: None, + scope: None, + tag_key: None, + tag_value_patterns: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn enabled(mut self, value: bool) -> Self { + self.enabled = Some(value); + self + } + + pub fn negated(mut self, value: bool) -> Self { + self.negated = Some(value); + self + } + + pub fn policy_name(mut self, value: String) -> Self { + self.policy_name = Some(value); + self + } + + pub fn policy_type(mut self, value: crate::datadogV2::model::TagPolicyType) -> Self { + self.policy_type = Some(value); + self + } + + pub fn required(mut self, value: bool) -> Self { + self.required = Some(value); + self + } + + pub fn scope(mut self, value: String) -> Self { + self.scope = Some(value); + self + } + + pub fn tag_key(mut self, value: String) -> Self { + self.tag_key = Some(value); + self + } + + pub fn tag_value_patterns(mut self, value: Vec) -> Self { + self.tag_value_patterns = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for TagPolicyUpdateAttributes { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for TagPolicyUpdateAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyUpdateAttributesVisitor; + impl<'a> Visitor<'a> for TagPolicyUpdateAttributesVisitor { + type Value = TagPolicyUpdateAttributes; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut enabled: Option = None; + let mut negated: Option = None; + let mut policy_name: Option = None; + let mut policy_type: Option = None; + let mut required: Option = None; + let mut scope: Option = None; + let mut tag_key: Option = None; + let mut tag_value_patterns: Option> = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "enabled" => { + if v.is_null() { + continue; + } + enabled = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "negated" => { + if v.is_null() { + continue; + } + negated = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_name" => { + if v.is_null() { + continue; + } + policy_name = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "policy_type" => { + if v.is_null() { + continue; + } + policy_type = + Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _policy_type) = policy_type { + match _policy_type { + crate::datadogV2::model::TagPolicyType::UnparsedObject( + _policy_type, + ) => { + _unparsed = true; + } + _ => {} + } + } + } + "required" => { + if v.is_null() { + continue; + } + required = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "scope" => { + if v.is_null() { + continue; + } + scope = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tag_key" => { + if v.is_null() { + continue; + } + tag_key = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "tag_value_patterns" => { + if v.is_null() { + continue; + } + tag_value_patterns = + 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); + } + } + } + } + + let content = TagPolicyUpdateAttributes { + enabled, + negated, + policy_name, + policy_type, + required, + scope, + tag_key, + tag_value_patterns, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyUpdateAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_update_data.rs b/src/datadogV2/model/model_tag_policy_update_data.rs new file mode 100644 index 0000000000..5ddccf193e --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_update_data.rs @@ -0,0 +1,132 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Data object for updating a tag policy. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyUpdateData { + /// Mutable attributes of a tag policy. Each field is optional; omitting a field leaves its + /// current value unchanged. The `source` of a policy cannot be changed. + #[serde(rename = "attributes")] + pub attributes: Option, + /// The unique identifier of the tag policy being updated. + #[serde(rename = "id")] + pub id: String, + /// JSON:API resource type for a tag policy. + #[serde(rename = "type")] + pub type_: crate::datadogV2::model::TagPolicyResourceType, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyUpdateData { + pub fn new( + id: String, + type_: crate::datadogV2::model::TagPolicyResourceType, + ) -> TagPolicyUpdateData { + TagPolicyUpdateData { + attributes: None, + id, + type_, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn attributes(mut self, value: crate::datadogV2::model::TagPolicyUpdateAttributes) -> Self { + self.attributes = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyUpdateData { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyUpdateDataVisitor; + impl<'a> Visitor<'a> for TagPolicyUpdateDataVisitor { + type Value = TagPolicyUpdateData; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut attributes: Option = + None; + let mut id: Option = None; + let mut type_: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "attributes" => { + if v.is_null() { + continue; + } + attributes = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "id" => { + id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + } + "type" => { + type_ = Some(serde_json::from_value(v).map_err(M::Error::custom)?); + if let Some(ref _type_) = type_ { + match _type_ { + crate::datadogV2::model::TagPolicyResourceType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + let id = id.ok_or_else(|| M::Error::missing_field("id"))?; + let type_ = type_.ok_or_else(|| M::Error::missing_field("type_"))?; + + let content = TagPolicyUpdateData { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyUpdateDataVisitor) + } +} diff --git a/src/datadogV2/model/model_tag_policy_update_request.rs b/src/datadogV2/model/model_tag_policy_update_request.rs new file mode 100644 index 0000000000..a89b89c733 --- /dev/null +++ b/src/datadogV2/model/model_tag_policy_update_request.rs @@ -0,0 +1,92 @@ +// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. +// This product includes software developed at Datadog (https://www.datadoghq.com/). +// Copyright 2019-Present Datadog, Inc. +use serde::de::{Error, MapAccess, Visitor}; +use serde::{Deserialize, Deserializer, Serialize}; +use serde_with::skip_serializing_none; +use std::fmt::{self, Formatter}; + +/// Payload for updating an existing tag policy. Only the supplied fields are modified. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct TagPolicyUpdateRequest { + /// Data object for updating a tag policy. + #[serde(rename = "data")] + pub data: crate::datadogV2::model::TagPolicyUpdateData, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl TagPolicyUpdateRequest { + pub fn new(data: crate::datadogV2::model::TagPolicyUpdateData) -> TagPolicyUpdateRequest { + TagPolicyUpdateRequest { + data, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl<'de> Deserialize<'de> for TagPolicyUpdateRequest { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct TagPolicyUpdateRequestVisitor; + impl<'a> Visitor<'a> for TagPolicyUpdateRequestVisitor { + type Value = TagPolicyUpdateRequest; + + fn expecting(&self, f: &mut Formatter<'_>) -> fmt::Result { + f.write_str("a mapping") + } + + fn visit_map(self, mut map: M) -> Result + where + M: MapAccess<'a>, + { + let mut data: Option = None; + let mut additional_properties: std::collections::BTreeMap< + String, + serde_json::Value, + > = std::collections::BTreeMap::new(); + let mut _unparsed = false; + + while let Some((k, v)) = map.next_entry::()? { + match k.as_str() { + "data" => { + data = 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); + } + } + } + } + let data = data.ok_or_else(|| M::Error::missing_field("data"))?; + + let content = TagPolicyUpdateRequest { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(TagPolicyUpdateRequestVisitor) + } +} diff --git a/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen b/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen deleted file mode 100644 index 1ed50bd716..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:29.760Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.json b/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.json deleted file mode 100644 index 67c6ccf47d..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Create-a-new-incident-service-returns-CREATED-response.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "http_interactions": [ - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Create_a_new_incident_service_returns_CREATED_response-1652349089\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "post", - "uri": "https://api.datadoghq.com/api/v2/services" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"aa4526fd-8084-58a0-bd52-164cd7f1a51e\",\"attributes\":{\"name\":\"Test-Create_a_new_incident_service_returns_CREATED_response-1652349089\",\"created\":\"2022-05-12T09:51:30.250528+00:00\",\"modified\":\"2022-05-12T09:51:30.250528+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 201, - "message": "Created" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:29 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/aa4526fd-8084-58a0-bd52-164cd7f1a51e" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:29 GMT" - } - ], - "recorded_with": "VCR 6.0.0" -} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen deleted file mode 100644 index 6a8b97d928..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:30.710Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.json b/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.json deleted file mode 100644 index 7057fb98d9..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Delete-an-existing-incident-service-returns-OK-response.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "http_interactions": [ - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Delete_an_existing_incident_service_returns_OK_response-1652349090\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "post", - "uri": "https://api.datadoghq.com/api/v2/services" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"9f42d0e5-438a-5808-bb84-01ede3c065fb\",\"attributes\":{\"name\":\"Test-Delete_an_existing_incident_service_returns_OK_response-1652349090\",\"created\":\"2022-05-12T09:51:31.181927+00:00\",\"modified\":\"2022-05-12T09:51:31.181927+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 201, - "message": "Created" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:30 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/9f42d0e5-438a-5808-bb84-01ede3c065fb" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:30 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/9f42d0e5-438a-5808-bb84-01ede3c065fb" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:30 GMT" - } - ], - "recorded_with": "VCR 6.0.0" -} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen deleted file mode 100644 index fe0e8ff0de..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:32.124Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.json b/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.json deleted file mode 100644 index b2a60ec4fe..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Get-a-list-of-all-incident-services-returns-OK-response.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "http_interactions": [ - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "post", - "uri": "https://api.datadoghq.com/api/v2/services" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"84fc985e-fd2b-5e37-b627-eee699786658\",\"attributes\":{\"name\":\"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092\",\"created\":\"2022-05-12T09:51:32.548997+00:00\",\"modified\":\"2022-05-12T09:51:32.548997+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 201, - "message": "Created" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:32 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "application/json" - ] - }, - "method": "get", - "uri": "https://api.datadoghq.com/api/v2/services?filter=Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092" - }, - "response": { - "body": { - "string": "{\"meta\":{\"sort\":\"ASC\",\"pagination\":{\"total\":7805,\"size\":1,\"next_offset\":1,\"offset\":0},\"total\":7805},\"data\":[{\"type\":\"services\",\"id\":\"84fc985e-fd2b-5e37-b627-eee699786658\",\"attributes\":{\"name\":\"Test-Get_a_list_of_all_incident_services_returns_OK_response-1652349092\",\"created\":\"2022-05-12T09:51:32.548997+00:00\",\"modified\":\"2022-05-12T09:51:32.548997+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}]}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 200, - "message": "OK" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:32 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/84fc985e-fd2b-5e37-b627-eee699786658" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:32 GMT" - } - ], - "recorded_with": "VCR 6.0.0" -} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen deleted file mode 100644 index 44bfb43319..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:33.610Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.json b/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.json deleted file mode 100644 index 9f149892c9..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Get-details-of-an-incident-service-returns-OK-response.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "http_interactions": [ - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "post", - "uri": "https://api.datadoghq.com/api/v2/services" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"e7c6527e-95ff-5ab1-b151-ba4f786038c0\",\"attributes\":{\"name\":\"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093\",\"created\":\"2022-05-12T09:51:34.184497+00:00\",\"modified\":\"2022-05-12T09:51:34.184497+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 201, - "message": "Created" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:33 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "application/json" - ] - }, - "method": "get", - "uri": "https://api.datadoghq.com/api/v2/services/e7c6527e-95ff-5ab1-b151-ba4f786038c0" - }, - "response": { - "body": { - "string": "{\"data\":{\"type\":\"services\",\"id\":\"e7c6527e-95ff-5ab1-b151-ba4f786038c0\",\"attributes\":{\"name\":\"Test-Get_details_of_an_incident_service_returns_OK_response-1652349093\",\"created\":\"2022-05-12T09:51:34.184497+00:00\",\"modified\":\"2022-05-12T09:51:34.184497+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 200, - "message": "OK" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:33 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/e7c6527e-95ff-5ab1-b151-ba4f786038c0" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:33 GMT" - } - ], - "recorded_with": "VCR 6.0.0" -} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen deleted file mode 100644 index 45de6e2ecb..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.frozen +++ /dev/null @@ -1 +0,0 @@ -2022-05-12T09:51:35.154Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.json b/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.json deleted file mode 100644 index 7c1ae84318..0000000000 --- a/tests/scenarios/cassettes/v2/incident_services/Update-an-existing-incident-service-returns-OK-response.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "http_interactions": [ - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_existing_incident_service_returns_OK_response-1652349095\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "post", - "uri": "https://api.datadoghq.com/api/v2/services" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"f9f4467a-1e31-5513-83b8-ca6c4287a9b3\",\"attributes\":{\"name\":\"Test-Update_an_existing_incident_service_returns_OK_response-1652349095\",\"created\":\"2022-05-12T09:51:35.599056+00:00\",\"modified\":\"2022-05-12T09:51:35.599056+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 201, - "message": "Created" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:35 GMT" - }, - { - "request": { - "body": { - "string": "{\"data\":{\"attributes\":{\"name\":\"Test-Update_an_existing_incident_service_returns_OK_response-1652349095-updated\"},\"type\":\"services\"}}", - "encoding": null - }, - "headers": { - "Accept": [ - "application/json" - ], - "Content-Type": [ - "application/json" - ] - }, - "method": "patch", - "uri": "https://api.datadoghq.com/api/v2/services/f9f4467a-1e31-5513-83b8-ca6c4287a9b3" - }, - "response": { - "body": { - "string": "{\"included\":[{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\",\"attributes\":{\"name\":null,\"handle\":\"frog@datadoghq.com\",\"created_at\":\"2019-10-02T08:15:39.795051+00:00\",\"modified_at\":\"2020-06-15T12:33:12.884459+00:00\",\"email\":\"frog@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/28a16dfe36e73b60c1d55872cb0f1172?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\"},\"relationships\":{\"org\":{\"data\":{\"type\":\"orgs\",\"id\":\"4dee724d-00cc-11ea-a77b-570c9d03c6c5\"}}}}],\"data\":{\"type\":\"services\",\"id\":\"f9f4467a-1e31-5513-83b8-ca6c4287a9b3\",\"attributes\":{\"name\":\"Test-Update_an_existing_incident_service_returns_OK_response-1652349095-updated\",\"created\":\"2022-05-12T09:51:35.599056+00:00\",\"modified\":\"2022-05-12T09:51:36.165537+00:00\"},\"relationships\":{\"last_modified_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}},\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"3ad549bf-eba0-11e9-a77a-0705486660d0\"}}}}}", - "encoding": null - }, - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "status": { - "code": 200, - "message": "OK" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:35 GMT" - }, - { - "request": { - "body": "", - "headers": { - "Accept": [ - "*/*" - ] - }, - "method": "delete", - "uri": "https://api.datadoghq.com/api/v2/services/f9f4467a-1e31-5513-83b8-ca6c4287a9b3" - }, - "response": { - "body": { - "string": "", - "encoding": null - }, - "headers": {}, - "status": { - "code": 204, - "message": "No Content" - } - }, - "recorded_at": "Thu, 12 May 2022 09:51:35 GMT" - } - ], - "recorded_with": "VCR 6.0.0" -} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen new file mode 100644 index 0000000000..86182034b5 --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.frozen @@ -0,0 +1 @@ +2026-06-12T09:57:22.725Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.json new file mode 100644 index 0000000000..7e0b79501e --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Conflict-response.json @@ -0,0 +1,125 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "string": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242\",\"createdAt\":1781258244898,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"version\":1,\"id\":\"xrz-jfq-dfm\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creationAuthorId\":2320499,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"updater\":{\"handle\":\"\",\"name\":\"\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:22 GMT" + }, + { + "request": { + "body": { + "string": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule updated\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[]}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "put", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Conflict_response-1781258242-updated\",\"isEnabled\":true,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule updated\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"id\":\"xrz-jfq-dfm\",\"version\":2,\"createdAt\":1781258244898,\"creationAuthorId\":2320499,\"updateAuthorId\":2320499,\"updatedAt\":1781258245104,\"isDefault\":false,\"blocking\":false,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"metadata\":{\"entities\":null,\"sources\":null}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:22 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm/restore/2" + }, + "response": { + "body": { + "string": "{\"error\":{\"code\":\"AlreadyExists\",\"message\":\"Cannot restore: target version is the current version.\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 409, + "message": "Conflict" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:22 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "*/*" + ] + }, + "method": "delete", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/xrz-jfq-dfm" + }, + "response": { + "body": { + "string": "", + "encoding": null + }, + "headers": {}, + "status": { + "code": 204, + "message": "No Content" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:22 GMT" + } + ], + "recorded_with": "VCR 6.0.0" +} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen new file mode 100644 index 0000000000..d762af22af --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-06-12T08:39:41.348Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.json new file mode 100644 index 0000000000..b7dea5d4bf --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-Not-Found-response.json @@ -0,0 +1,91 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "string": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Not_Found_response-1781253581\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_Not_Found_response-1781253581\",\"createdAt\":1781253581645,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"version\":1,\"id\":\"uig-ynq-xlh\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creationAuthorId\":2320499,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"updater\":{\"handle\":\"\",\"name\":\"\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 08:39:41 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/uig-ynq-xlh/restore/9999" + }, + "response": { + "body": { + "string": "{\"error\":{\"code\":\"NotFound\",\"message\":\"Threat detection rule not found: uig-ynq-xlh, version=9999\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 404, + "message": "Not Found" + } + }, + "recorded_at": "Fri, 12 Jun 2026 08:39:41 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "*/*" + ] + }, + "method": "delete", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/uig-ynq-xlh" + }, + "response": { + "body": { + "string": "", + "encoding": null + }, + "headers": {}, + "status": { + "code": 204, + "message": "No Content" + } + }, + "recorded_at": "Fri, 12 Jun 2026 08:39:41 GMT" + } + ], + "recorded_with": "VCR 6.0.0" +} \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen new file mode 100644 index 0000000000..47bbb311c9 --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-06-12T09:57:25.549Z \ No newline at end of file diff --git a/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.json b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.json new file mode 100644 index 0000000000..74702abde3 --- /dev/null +++ b/tests/scenarios/cassettes/v2/security_monitoring/Restore-a-rule-to-a-historical-version-returns-OK-response.json @@ -0,0 +1,125 @@ +{ + "http_interactions": [ + { + "request": { + "body": { + "string": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[],\"type\":\"log_detection\"}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245\",\"createdAt\":1781258245670,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"version\":1,\"id\":\"7sm-pyl-xzv\",\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creationAuthorId\":2320499,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"updater\":{\"handle\":\"\",\"name\":\"\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:25 GMT" + }, + { + "request": { + "body": { + "string": "{\"cases\":[{\"condition\":\"a > 0\",\"name\":\"\",\"notifications\":[],\"status\":\"info\"}],\"filters\":[],\"isEnabled\":true,\"message\":\"Test rule updated\",\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245-updated\",\"options\":{\"evaluationWindow\":900,\"keepAlive\":3600,\"maxSignalDuration\":86400},\"queries\":[{\"aggregation\":\"count\",\"distinctFields\":[],\"groupByFields\":[],\"metrics\":[],\"query\":\"@test:true\"}],\"tags\":[]}", + "encoding": null + }, + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json" + ] + }, + "method": "put", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245-updated\",\"isEnabled\":true,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule updated\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"id\":\"7sm-pyl-xzv\",\"version\":2,\"createdAt\":1781258245670,\"creationAuthorId\":2320499,\"updateAuthorId\":2320499,\"updatedAt\":1781258245844,\"isDefault\":false,\"blocking\":false,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"metadata\":{\"entities\":null,\"sources\":null}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:25 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "application/json" + ] + }, + "method": "post", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv/restore/1" + }, + "response": { + "body": { + "string": "{\"name\":\"Test-Restore_a_rule_to_a_historical_version_returns_OK_response-1781258245\",\"createdAt\":1781258245670,\"isDefault\":false,\"isPartner\":false,\"isEnabled\":true,\"isBeta\":false,\"isDeleted\":false,\"isDeprecated\":false,\"queries\":[{\"query\":\"@test:true\",\"groupByFields\":[],\"hasOptionalGroupByFields\":false,\"distinctFields\":[],\"aggregation\":\"count\",\"name\":\"\",\"dataSource\":\"logs\"}],\"options\":{\"evaluationWindow\":900,\"detectionMethod\":\"threshold\",\"maxSignalDuration\":86400,\"keepAlive\":3600},\"cases\":[{\"name\":\"\",\"status\":\"info\",\"notifications\":[],\"condition\":\"a \\u003e 0\"}],\"message\":\"Test rule\",\"tags\":[],\"hasExtendedTitle\":false,\"type\":\"log_detection\",\"filters\":[],\"version\":3,\"id\":\"7sm-pyl-xzv\",\"updatedAt\":1781258246099,\"blocking\":false,\"metadata\":{\"entities\":null,\"sources\":null},\"creationAuthorId\":2320499,\"updateAuthorId\":2320499,\"creator\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"},\"updater\":{\"handle\":\"9919ec9b-ebc7-49ee-8dc8-03626e717cca\",\"name\":\"CI Account\"}}", + "encoding": null + }, + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "status": { + "code": 200, + "message": "OK" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:25 GMT" + }, + { + "request": { + "body": "", + "headers": { + "Accept": [ + "*/*" + ] + }, + "method": "delete", + "uri": "https://api.datadoghq.com/api/v2/security_monitoring/rules/7sm-pyl-xzv" + }, + "response": { + "body": { + "string": "", + "encoding": null + }, + "headers": {}, + "status": { + "code": 204, + "message": "No Content" + } + }, + "recorded_at": "Fri, 12 Jun 2026 09:57:25 GMT" + } + ], + "recorded_with": "VCR 6.0.0" +} \ No newline at end of file diff --git a/tests/scenarios/features/v2/given.json b/tests/scenarios/features/v2/given.json index 0a6db71d71..f5ce3365da 100644 --- a/tests/scenarios/features/v2/given.json +++ b/tests/scenarios/features/v2/given.json @@ -674,6 +674,22 @@ "tag": "Google Chat Integration", "operationId": "CreateOrganizationHandle" }, + { + "parameters": [ + { + "name": "organization_binding_id", + "value": "\"e54cb570-c674-529c-769d-84b312288ed7\"" + }, + { + "name": "body", + "value": "{\n \"data\": {\n \"type\": \"google-chat-target-audience\",\n \"attributes\": {\n \"audience_name\": \"{{ unique }}\",\n \"audience_id\": \"{{ unique }}\"\n }\n }\n}" + } + ], + "step": "there is a valid \"google_chat_target_audience\" in the system", + "key": "google_chat_target_audience", + "tag": "Google Chat Integration", + "operationId": "CreateGoogleChatTargetAudience" + }, { "parameters": [ { @@ -1406,6 +1422,22 @@ "tag": "Security Monitoring", "operationId": "CreateSecurityMonitoringRule" }, + { + "parameters": [ + { + "name": "rule_id", + "source": "security_rule.id" + }, + { + "name": "body", + "value": "{\n \"name\": \"{{ unique }}-updated\",\n \"queries\": [{\n \"query\": \"@test:true\",\n \"aggregation\": \"count\",\n \"groupByFields\": [],\n \"distinctFields\": [],\n \"metrics\": []\n }],\n \"filters\": [],\n \"cases\": [{\n \"name\": \"\",\n \"status\": \"info\",\n \"condition\": \"a > 0\",\n \"notifications\": []\n }],\n \"options\": {\n \"evaluationWindow\": 900,\n \"keepAlive\": 3600,\n \"maxSignalDuration\": 86400\n },\n \"message\": \"Test rule updated\",\n \"tags\": [],\n \"isEnabled\": true\n}" + } + ], + "step": "there is a valid \"security_rule_updated\" in the system", + "key": "security_rule_updated", + "tag": "Security Monitoring", + "operationId": "UpdateSecurityMonitoringRule" + }, { "step": "a valid \"configuration\" in the system", "key": "configuration", @@ -1480,18 +1512,6 @@ "tag": "Service Accounts", "operationId": "CreateServiceAccountApplicationKey" }, - { - "parameters": [ - { - "name": "body", - "value": "{\n \"data\": {\n \"attributes\": {\n \"name\": \"{{ unique }}\"\n },\n \"type\": \"services\"\n }\n}" - } - ], - "step": "there is a valid \"service\" in the system", - "key": "service", - "tag": "Incident Services", - "operationId": "CreateIncidentService" - }, { "parameters": [ { diff --git a/tests/scenarios/features/v2/google_chat_integration.feature b/tests/scenarios/features/v2/google_chat_integration.feature index f722a7ea20..65c1f264a6 100644 --- a/tests/scenarios/features/v2/google_chat_integration.feature +++ b/tests/scenarios/features/v2/google_chat_integration.feature @@ -9,6 +9,38 @@ Feature: Google Chat Integration And a valid "appKeyAuth" key in the system And an instance of "GoogleChatIntegration" API + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Bad Request" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "CREATED" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 201 CREATED + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Conflict" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/chat-integrations + Scenario: Create a target audience returns "Not Found" response + Given new "CreateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/chat-integrations Scenario: Create organization handle returns "Bad Request" response Given new "CreateOrganizationHandle" request @@ -42,6 +74,36 @@ Feature: Google Chat Integration When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a Google Chat organization binding returns "Bad Request" response + Given new "DeleteGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a Google Chat organization binding returns "OK" response + Given new "DeleteGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a target audience returns "Not Found" response + Given new "DeleteGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete a target audience returns "OK" response + Given new "DeleteGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Delete organization handle returns "Bad Request" response Given new "DeleteOrganizationHandle" request @@ -59,6 +121,56 @@ Feature: Google Chat Integration When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete the delegated user returns "Not Found" response + Given new "DeleteGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete the delegated user returns "OK" response + Given new "DeleteGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a Google Chat organization binding returns "Not Found" response + Given new "GetGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a Google Chat organization binding returns "OK" response + Given new "GetGoogleChatOrganization" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a target audience returns "Not Found" response + Given new "GetGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get a target audience returns "OK" response + Given new "GetGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all Google Chat organization bindings returns "OK" response + Given new "ListGoogleChatOrganizations" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Get all organization handles returns "Bad Request" response Given new "ListOrganizationHandles" request @@ -82,6 +194,20 @@ Feature: Google Chat Integration Then the response status is 200 OK And the response "data[0].type" is equal to "google-chat-organization-handle" + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all target audiences returns "Not Found" response + Given new "ListGoogleChatTargetAudiences" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get all target audiences returns "OK" response + Given new "ListGoogleChatTargetAudiences" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Get organization handle returns "Bad Request" response Given new "GetOrganizationHandle" request @@ -136,6 +262,47 @@ Feature: Google Chat Integration And the response "data.attributes.resource_name" is equal to "spaces/AAQA-zFIks8" And the response "data.attributes.organization_binding_id" is equal to "e54cb570-c674-529c-769d-84b312288ed7" + @generated @skip @team:DataDog/chat-integrations + Scenario: Get the delegated user returns "Not Found" response + Given new "GetGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Get the delegated user returns "OK" response + Given new "GetGoogleChatDelegatedUser" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "Bad Request" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "Not Found" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/chat-integrations + Scenario: Update a target audience returns "OK" response + Given new "UpdateGoogleChatTargetAudience" request + And request contains "organization_binding_id" parameter from "REPLACE.ME" + And request contains "target_audience_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"audience_id": "fake-audience-id-1", "audience_name": "fake audience name 1"}, "type": "google-chat-target-audience"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/chat-integrations Scenario: Update organization handle returns "Bad Request" response Given new "UpdateOrganizationHandle" request diff --git a/tests/scenarios/features/v2/incident_services.feature b/tests/scenarios/features/v2/incident_services.feature deleted file mode 100644 index eb5e5716d4..0000000000 --- a/tests/scenarios/features/v2/incident_services.feature +++ /dev/null @@ -1,146 +0,0 @@ -@endpoint(incident-services) @endpoint(incident-services-v2) -Feature: Incident Services - Create, update, delete, and retrieve services which can be associated with - incidents. See the [Incident Management - page](https://docs.datadoghq.com/service_management/incident_management/) - for more information. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "IncidentServices" API - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident service returns "Bad Request" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"attributes": {"name": "an example service name"}, "type": "services"}} - When the request is sent - Then the response status is 400 Bad Request - - @team:Datadog/incident-app - Scenario: Create a new incident service returns "CREATED" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"type": "services", "attributes": {"name": "{{ unique }}"}}} - When the request is sent - Then the response status is 201 CREATED - And the response "data.attributes.name" is equal to "{{ unique }}" - And the response "data.type" is equal to "services" - - @generated @skip @team:Datadog/incident-app - Scenario: Create a new incident service returns "Not Found" response - Given operation "CreateIncidentService" enabled - And new "CreateIncidentService" request - And body with value {"data": {"attributes": {"name": "an example service name"}, "type": "services"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "Bad Request" response - Given operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "Not Found" response - Given operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Delete an existing incident service returns "OK" response - Given there is a valid "service" in the system - And operation "DeleteIncidentService" enabled - And new "DeleteIncidentService" request - And request contains "service_id" parameter from "service.data.id" - When the request is sent - Then the response status is 204 OK - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "Bad Request" response - Given operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "Not Found" response - Given operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get a list of all incident services returns "OK" response - Given there is a valid "service" in the system - And operation "ListIncidentServices" enabled - And new "ListIncidentServices" request - And request contains "filter" parameter from "service.data.attributes.name" - When the request is sent - Then the response status is 200 OK - And the response "data" has length 1 - And the response "data[0].attributes.name" has the same value as "service.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident service returns "Bad Request" response - Given operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Get details of an incident service returns "Not Found" response - Given operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Get details of an incident service returns "OK" response - Given there is a valid "service" in the system - And operation "GetIncidentService" enabled - And new "GetIncidentService" request - And request contains "service_id" parameter from "service.data.id" - When the request is sent - Then the response status is 200 OK - And the response "data.id" is equal to "{{service.data.id}}" - And the response "data.type" is equal to "services" - And the response "data.attributes.name" has the same value as "service.data.attributes.name" - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident service returns "Bad Request" response - Given operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "an example service name"}, "id": "00000000-0000-0000-0000-000000000000", "type": "services"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:Datadog/incident-app - Scenario: Update an existing incident service returns "Not Found" response - Given operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"name": "an example service name"}, "id": "00000000-0000-0000-0000-000000000000", "type": "services"}} - When the request is sent - Then the response status is 404 Not Found - - @team:Datadog/incident-app - Scenario: Update an existing incident service returns "OK" response - Given there is a valid "service" in the system - And operation "UpdateIncidentService" enabled - And new "UpdateIncidentService" request - And request contains "service_id" parameter from "service.data.id" - And body with value {"data": {"type": "services", "attributes": {"name": "{{ service.data.attributes.name }}-updated"}}} - When the request is sent - Then the response status is 200 OK - And the response "data.id" is equal to "{{service.data.id}}" - And the response "data.type" is equal to "services" - And the response "data.attributes.name" is equal to "{{ service.data.attributes.name }}-updated" diff --git a/tests/scenarios/features/v2/llm_observability.feature b/tests/scenarios/features/v2/llm_observability.feature index 842377375a..35e9592fa0 100644 --- a/tests/scenarios/features/v2/llm_observability.feature +++ b/tests/scenarios/features/v2/llm_observability.feature @@ -315,6 +315,30 @@ Feature: LLM Observability When the request is sent Then the response status is 422 Unprocessable Entity + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update a patterns configuration returns "Bad Request" response + Given operation "UpsertLLMObsPatternsConfig" enabled + And new "UpsertLLMObsPatternsConfig" request + And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update a patterns configuration returns "Not Found" response + Given operation "UpsertLLMObsPatternsConfig" enabled + And new "UpsertLLMObsPatternsConfig" request + And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Create or update a patterns configuration returns "OK" response + Given operation "UpsertLLMObsPatternsConfig" enabled + And new "UpsertLLMObsPatternsConfig" request + And body with value {"data": {"attributes": {"account_id": "1000000001", "config_id": "a7c8d9e0-1234-5678-9abc-def012345678", "evp_query": "@ml_app:support-bot", "hierarchy_depth": 2, "integration_provider": "openai", "model_name": "gpt-4o", "name": "Support chatbot topics", "num_records": 1000, "sampling_ratio": 0.1, "scope": "", "template": ""}, "type": "topic_discovery_configs"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Create or update annotations returns "Bad Request" response Given operation "UpsertLLMObsAnnotations" enabled @@ -471,6 +495,30 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Delete a patterns configuration returns "Bad Request" response + Given operation "DeleteLLMObsPatternsConfig" enabled + And new "DeleteLLMObsPatternsConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete a patterns configuration returns "No Content" response + Given operation "DeleteLLMObsPatternsConfig" enabled + And new "DeleteLLMObsPatternsConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/ml-observability + Scenario: Delete a patterns configuration returns "Not Found" response + Given operation "DeleteLLMObsPatternsConfig" enabled + And new "DeleteLLMObsPatternsConfig" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability Scenario: Delete an LLM Observability annotation queue returns "No Content" response Given operation "DeleteLLMObsAnnotationQueue" enabled @@ -619,6 +667,27 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Get a patterns configuration returns "Bad Request" response + Given operation "GetLLMObsPatternsConfig" enabled + And new "GetLLMObsPatternsConfig" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get a patterns configuration returns "Not Found" response + Given operation "GetLLMObsPatternsConfig" enabled + And new "GetLLMObsPatternsConfig" request + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get a patterns configuration returns "OK" response + Given operation "GetLLMObsPatternsConfig" enabled + And new "GetLLMObsPatternsConfig" request + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get annotated interactions by content IDs returns "Bad Request" response Given operation "GetLLMObsAnnotatedInteractionsByTraceIDs" enabled @@ -675,6 +744,30 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Get patterns run status returns "Bad Request" response + Given operation "GetLLMObsPatternsRunStatus" enabled + And new "GetLLMObsPatternsRunStatus" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get patterns run status returns "Not Found" response + Given operation "GetLLMObsPatternsRunStatus" enabled + And new "GetLLMObsPatternsRunStatus" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get patterns run status returns "OK" response + Given operation "GetLLMObsPatternsRunStatus" enabled + And new "GetLLMObsPatternsRunStatus" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability annotation queues returns "Bad Request" response Given operation "ListLLMObsAnnotationQueues" enabled @@ -915,6 +1008,116 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns clustered points returns "Bad Request" response + Given operation "ListLLMObsPatternsClusteredPoints" enabled + And new "ListLLMObsPatternsClusteredPoints" request + And request contains "topic_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns clustered points returns "Not Found" response + Given operation "ListLLMObsPatternsClusteredPoints" enabled + And new "ListLLMObsPatternsClusteredPoints" request + And request contains "topic_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns clustered points returns "OK" response + Given operation "ListLLMObsPatternsClusteredPoints" enabled + And new "ListLLMObsPatternsClusteredPoints" request + And request contains "topic_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns configurations returns "Bad Request" response + Given operation "ListLLMObsPatternsConfigs" enabled + And new "ListLLMObsPatternsConfigs" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns configurations returns "OK" response + Given operation "ListLLMObsPatternsConfigs" enabled + And new "ListLLMObsPatternsConfigs" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns runs returns "Bad Request" response + Given operation "ListLLMObsPatternsRuns" enabled + And new "ListLLMObsPatternsRuns" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns runs returns "Not Found" response + Given operation "ListLLMObsPatternsRuns" enabled + And new "ListLLMObsPatternsRuns" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns runs returns "OK" response + Given operation "ListLLMObsPatternsRuns" enabled + And new "ListLLMObsPatternsRuns" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics returns "Bad Request" response + Given operation "ListLLMObsPatternsTopics" enabled + And new "ListLLMObsPatternsTopics" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics returns "Not Found" response + Given operation "ListLLMObsPatternsTopics" enabled + And new "ListLLMObsPatternsTopics" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics returns "OK" response + Given operation "ListLLMObsPatternsTopics" enabled + And new "ListLLMObsPatternsTopics" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics with clustered points returns "Bad Request" response + Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + And new "ListLLMObsPatternsTopicsWithClusteredPoints" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics with clustered points returns "Not Found" response + Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + And new "ListLLMObsPatternsTopicsWithClusteredPoints" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List patterns topics with clustered points returns "OK" response + Given operation "ListLLMObsPatternsTopicsWithClusteredPoints" enabled + And new "ListLLMObsPatternsTopicsWithClusteredPoints" request + And request contains "config_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Lock LLM Observability dataset draft state returns "Bad Request" response Given operation "LockLLMObsDatasetDraftState" enabled @@ -1075,6 +1278,30 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Trigger a patterns run returns "Accepted" response + Given operation "TriggerLLMObsPatterns" enabled + And new "TriggerLLMObsPatterns" request + And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} + When the request is sent + Then the response status is 202 Accepted + + @generated @skip @team:DataDog/ml-observability + Scenario: Trigger a patterns run returns "Bad Request" response + Given operation "TriggerLLMObsPatterns" enabled + And new "TriggerLLMObsPatterns" request + And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Trigger a patterns run returns "Not Found" response + Given operation "TriggerLLMObsPatterns" enabled + And new "TriggerLLMObsPatterns" request + And body with value {"data": {"attributes": {"config_id": "a7c8d9e0-1234-5678-9abc-def012345678"}, "type": "topic_discovery"}} + When the request is sent + Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability Scenario: Unlock LLM Observability dataset draft state returns "Bad Request" response Given operation "UnlockLLMObsDatasetDraftState" enabled diff --git a/tests/scenarios/features/v2/microsoft_teams_integration.feature b/tests/scenarios/features/v2/microsoft_teams_integration.feature index d76425d375..ddbffd9627 100644 --- a/tests/scenarios/features/v2/microsoft_teams_integration.feature +++ b/tests/scenarios/features/v2/microsoft_teams_integration.feature @@ -146,6 +146,27 @@ Feature: Microsoft Teams Integration When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete user binding returns "Bad Request" response + Given new "DeleteMSTeamsUserBinding" request + And request contains "tenant_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete user binding returns "Failed Precondition" response + Given new "DeleteMSTeamsUserBinding" request + And request contains "tenant_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 412 Failed Precondition + + @generated @skip @team:DataDog/chat-integrations + Scenario: Delete user binding returns "No Content" response + Given new "DeleteMSTeamsUserBinding" request + And request contains "tenant_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + @team:DataDog/chat-integrations Scenario: Delete workflow webhook handle returns "OK" response Given there is a valid "workflows_webhook_handle" in the system diff --git a/tests/scenarios/features/v2/organizations.feature b/tests/scenarios/features/v2/organizations.feature index 01706fd558..a8ed63ab7e 100644 --- a/tests/scenarios/features/v2/organizations.feature +++ b/tests/scenarios/features/v2/organizations.feature @@ -61,6 +61,27 @@ Feature: Organizations When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "Bad Request" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: List global orgs returns "OK" response + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/delegated-auth-login @with-pagination + Scenario: List global orgs returns "OK" response with pagination + Given new "ListGlobalOrgs" request + And request contains "user_handle" parameter from "REPLACE.ME" + When the request with pagination is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/org-management Scenario: List your managed organizations returns "OK" response Given new "ListOrgs" request @@ -147,6 +168,20 @@ Feature: Organizations When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update the maximum session duration returns "Bad Request" response + Given new "UpdateLoginOrgConfigsMaxSessionDuration" request + And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/delegated-auth-login + Scenario: Update the maximum session duration returns "No Content" response + Given new "UpdateLoginOrgConfigsMaxSessionDuration" request + And body with value {"data": {"attributes": {"max_session_duration": 604800}, "type": "max_session_duration"}} + When the request is sent + Then the response status is 204 No Content + @skip-go @skip-java @skip-python @skip-ruby @skip-rust @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/delegated-auth-login Scenario: Upload IdP metadata returns "Bad Request - caused by either malformed XML or invalid SAML IdP metadata" response Given new "UploadIdPMetadata" request diff --git a/tests/scenarios/features/v2/rum_hardcoded_retention_filters.feature b/tests/scenarios/features/v2/rum_hardcoded_retention_filters.feature deleted file mode 100644 index 05e942989b..0000000000 --- a/tests/scenarios/features/v2/rum_hardcoded_retention_filters.feature +++ /dev/null @@ -1,59 +0,0 @@ -@endpoint(rum-hardcoded-retention-filters) @endpoint(rum-hardcoded-retention-filters-v2) -Feature: RUM Retention Filters Hardcoded - Manage hardcoded retention filters through [Manage - Applications](https://app.datadoghq.com/rum/list) in RUM. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "RUMRetentionFiltersHardcoded" API - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "Not Found" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "OK" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Get all hardcoded retention filters returns "OK" response - Given new "ListHardcodedRetentionFilters" request - And request contains "app_id" parameter with value "{{ unique }}" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Bad Request" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Not Found" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0}}}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Updated" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter with value "{{ unique }}" - And request contains "rf_id" parameter with value "{{ unique }}" - And body with value {"data": {"id": "REPLACE.ME", "type": "hardcoded_retention_filters", "attributes": {"cross_product_sampling": {"session_replay_sample_rate": 50.0, "session_replay_enabled": true}}}} - When the request is sent - Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/rum_retention_filters_hardcoded.feature b/tests/scenarios/features/v2/rum_retention_filters_hardcoded.feature deleted file mode 100644 index 2ce25e7a3a..0000000000 --- a/tests/scenarios/features/v2/rum_retention_filters_hardcoded.feature +++ /dev/null @@ -1,59 +0,0 @@ -@endpoint(rum-retention-filters-hardcoded) @endpoint(rum-retention-filters-hardcoded-v2) -Feature: RUM Retention Filters Hardcoded - Manage hardcoded retention filters through [Manage - Applications](https://app.datadoghq.com/rum/list) in RUM. - - Background: - Given a valid "apiKeyAuth" key in the system - And a valid "appKeyAuth" key in the system - And an instance of "RUMRetentionFiltersHardcoded" API - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "Not Found" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Get a hardcoded retention filter returns "OK" response - Given new "GetHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Get all hardcoded retention filters returns "OK" response - Given new "ListHardcodedRetentionFilters" request - And request contains "app_id" parameter from "REPLACE.ME" - When the request is sent - Then the response status is 200 OK - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Bad Request" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Not Found" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/rum-backend - Scenario: Update a hardcoded retention filter returns "Updated" response - Given new "UpdateHardcodedRetentionFilter" request - And request contains "app_id" parameter from "REPLACE.ME" - And request contains "rf_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cross_product_sampling": {"session_replay_enabled": true, "session_replay_sample_rate": 50.0, "trace_enabled": true, "trace_sample_rate": 25.0}}, "id": "forced_replay_sessions", "type": "hardcoded_retention_filters"}} - When the request is sent - Then the response status is 200 Updated diff --git a/tests/scenarios/features/v2/security_monitoring.feature b/tests/scenarios/features/v2/security_monitoring.feature index eb583c92cd..d6ec475edf 100644 --- a/tests/scenarios/features/v2/security_monitoring.feature +++ b/tests/scenarios/features/v2/security_monitoring.feature @@ -2532,6 +2532,48 @@ Feature: Security Monitoring When the request is sent Then the response status is 422 The server cannot process the request because it contains invalid data. + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Bad Request" response + Given operation "RestoreSecurityMonitoringRule" enabled + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "REPLACE.ME" + And request contains "version" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Conflict" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And there is a valid "security_rule_updated" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 2 + When the request is sent + Then the response status is 409 Conflict + + @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "Not Found" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 9999 + When the request is sent + Then the response status is 404 Not Found + + @skip-validation @team:DataDog/k9-cloud-siem + Scenario: Restore a rule to a historical version returns "OK" response + Given operation "RestoreSecurityMonitoringRule" enabled + And there is a valid "security_rule" in the system + And there is a valid "security_rule_updated" in the system + And new "RestoreSecurityMonitoringRule" request + And request contains "rule_id" parameter from "security_rule.id" + And request contains "version" parameter with value 1 + When the request is sent + Then the response status is 200 OK + And the response "id" has the same value as "security_rule.id" + @generated @skip @team:DataDog/k9-vm-ast Scenario: Returns a list of Secrets rules returns "OK" response Given operation "GetSecretsRules" enabled diff --git a/tests/scenarios/features/v2/slack_integration.feature b/tests/scenarios/features/v2/slack_integration.feature new file mode 100644 index 0000000000..0ef645a642 --- /dev/null +++ b/tests/scenarios/features/v2/slack_integration.feature @@ -0,0 +1,23 @@ +@endpoint(slack-integration) @endpoint(slack-integration-v2) +Feature: Slack Integration + Configure your [Datadog Slack + integration](https://docs.datadoghq.com/integrations/slack/) directly + through the Datadog API. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "SlackIntegration" API + And new "ListSlackUserBindings" request + + @generated @skip @team:DataDog/chat-integrations + Scenario: List Slack user bindings returns "Bad Request" response + Given request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/chat-integrations + Scenario: List Slack user bindings returns "OK" response + Given request contains "user_uuid" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/tag_policies.feature b/tests/scenarios/features/v2/tag_policies.feature new file mode 100644 index 0000000000..b5d064c202 --- /dev/null +++ b/tests/scenarios/features/v2/tag_policies.feature @@ -0,0 +1,150 @@ +@endpoint(tag-policies) @endpoint(tag-policies-v2) +Feature: Tag Policies + Tag Policies define rules that govern which tag values are accepted for a + given tag key, scoped to a particular telemetry source (such as logs, + spans, or metrics). Policies can be `blocking` (data not matching the + policy is rejected) or `surfacing` (matching data is highlighted but not + blocked). Each policy reports a compliance `score` derived from how much + recent telemetry adheres to the policy. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TagPolicies" API + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag policy returns "Bad Request" response + Given operation "CreateTagPolicy" enabled + And new "CreateTagPolicy" request + And body with value {"data": {"attributes": {"enabled": true, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag policy returns "Conflict" response + Given operation "CreateTagPolicy" enabled + And new "CreateTagPolicy" request + And body with value {"data": {"attributes": {"enabled": true, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} + When the request is sent + Then the response status is 409 Conflict + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Create a tag policy returns "Created" response + Given operation "CreateTagPolicy" enabled + And new "CreateTagPolicy" request + And body with value {"data": {"attributes": {"enabled": true, "negated": false, "policy_name": "Service tag must be one of api or web", "policy_type": "surfacing", "required": true, "scope": "env", "source": "logs", "tag_key": "service", "tag_value_patterns": ["api", "web"]}, "type": "tag_policy"}} + When the request is sent + Then the response status is 201 Created + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Delete a tag policy returns "Bad Request" response + Given operation "DeleteTagPolicy" enabled + And new "DeleteTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Delete a tag policy returns "No Content" response + Given operation "DeleteTagPolicy" enabled + And new "DeleteTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Delete a tag policy returns "Not Found" response + Given operation "DeleteTagPolicy" enabled + And new "DeleteTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy compliance score returns "Bad Request" response + Given operation "GetTagPolicyScore" enabled + And new "GetTagPolicyScore" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy compliance score returns "Not Found" response + Given operation "GetTagPolicyScore" enabled + And new "GetTagPolicyScore" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy compliance score returns "OK" response + Given operation "GetTagPolicyScore" enabled + And new "GetTagPolicyScore" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy returns "Bad Request" response + Given operation "GetTagPolicy" enabled + And new "GetTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy returns "Not Found" response + Given operation "GetTagPolicy" enabled + And new "GetTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Get a tag policy returns "OK" response + Given operation "GetTagPolicy" enabled + And new "GetTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List tag policies returns "Bad Request" response + Given operation "ListTagPolicies" enabled + And new "ListTagPolicies" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: List tag policies returns "OK" response + Given operation "ListTagPolicies" enabled + And new "ListTagPolicies" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a tag policy returns "Bad Request" response + Given operation "UpdateTagPolicy" enabled + And new "UpdateTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a tag policy returns "Not Found" response + Given operation "UpdateTagPolicy" enabled + And new "UpdateTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/aaa-governance-console + Scenario: Update a tag policy returns "OK" response + Given operation "UpdateTagPolicy" enabled + And new "UpdateTagPolicy" request + And request contains "policy_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"policy_type": "surfacing", "tag_value_patterns": []}, "id": "123", "type": "tag_policy"}} + When the request is sent + Then the response status is 200 OK diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 9d1d831d98..e947f19f57 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -2756,6 +2756,12 @@ "type": "idempotent" } }, + "ListGlobalOrgs": { + "tag": "Organizations", + "undo": { + "type": "safe" + } + }, "GetHamrOrgConnection": { "tag": "High Availability MultiRegion", "undo": { @@ -3389,12 +3395,42 @@ "type": "idempotent" } }, + "ListGoogleChatOrganizations": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, "GetSpaceByDisplayName": { "tag": "Google Chat Integration", "undo": { "type": "safe" } }, + "DeleteGoogleChatOrganization": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatOrganization": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "DeleteGoogleChatDelegatedUser": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatDelegatedUser": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, "ListOrganizationHandles": { "tag": "Google Chat Integration", "undo": { @@ -3437,6 +3473,48 @@ "type": "idempotent" } }, + "ListGoogleChatTargetAudiences": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "CreateGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "operationId": "DeleteGoogleChatTargetAudience", + "parameters": [ + { + "name": "organization_binding_id", + "origin": "path", + "source": "organization_binding_id" + }, + { + "name": "target_audience_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, + "GetGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "safe" + } + }, + "UpdateGoogleChatTargetAudience": { + "tag": "Google Chat Integration", + "undo": { + "type": "idempotent" + } + }, "ListJiraAccounts": { "tag": "Jira Integration", "undo": { @@ -3529,6 +3607,12 @@ "type": "idempotent" } }, + "DeleteMSTeamsUserBinding": { + "tag": "Microsoft Teams Integration", + "undo": { + "type": "idempotent" + } + }, "ListWorkflowsWebhookHandles": { "tag": "Microsoft Teams Integration", "undo": { @@ -3781,6 +3865,12 @@ "type": "safe" } }, + "ListSlackUserBindings": { + "tag": "Slack Integration", + "undo": { + "type": "safe" + } + }, "DeleteStatuspageAccount": { "tag": "Statuspage Integration", "undo": { @@ -4337,6 +4427,68 @@ "type": "safe" } }, + "ListLLMObsPatternsClusteredPoints": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsPatternsConfigs": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "UpsertLLMObsPatternsConfig": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "GetLLMObsPatternsConfig": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "DeleteLLMObsPatternsConfig": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "ListLLMObsPatternsRuns": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "TriggerLLMObsPatterns": { + "tag": "LLM Observability", + "undo": { + "operationId": "TODO", + "parameters": [], + "type": "unsafe" + } + }, + "GetLLMObsPatternsRunStatus": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsPatternsTopics": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "ListLLMObsPatternsTopicsWithClusteredPoints": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsDatasets": { "tag": "LLM Observability", "undo": { @@ -4470,6 +4622,12 @@ "type": "safe" } }, + "UpdateLoginOrgConfigsMaxSessionDuration": { + "tag": "Organizations", + "undo": { + "type": "idempotent" + } + }, "SubmitLog": { "tag": "Logs", "undo": { @@ -6323,24 +6481,6 @@ "type": "unsafe" } }, - "ListHardcodedRetentionFilters": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "safe" - } - }, - "GetHardcodedRetentionFilter": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "safe" - } - }, - "UpdateHardcodedRetentionFilter": { - "tag": "RUM Retention Filters Hardcoded", - "undo": { - "type": "idempotent" - } - }, "OrderRetentionFilters": { "tag": "Rum Retention Filters", "undo": { @@ -7361,6 +7501,12 @@ "type": "idempotent" } }, + "RestoreSecurityMonitoringRule": { + "tag": "Security Monitoring", + "undo": { + "type": "idempotent" + } + }, "TestExistingSecurityMonitoringRule": { "tag": "Security Monitoring", "undo": { @@ -7678,25 +7824,6 @@ "type": "idempotent" } }, - "ListIncidentServices": { - "tag": "Incident Services", - "undo": { - "type": "safe" - } - }, - "CreateIncidentService": { - "tag": "Incident Services", - "undo": { - "operationId": "DeleteIncidentService", - "parameters": [ - { - "name": "service_id", - "source": "data.id" - } - ], - "type": "unsafe" - } - }, "ListServiceDefinitions": { "tag": "Service Definition", "undo": { @@ -7728,24 +7855,6 @@ "type": "safe" } }, - "DeleteIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "idempotent" - } - }, - "GetIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "safe" - } - }, - "UpdateIncidentService": { - "tag": "Incident Services", - "undo": { - "type": "idempotent" - } - }, "ListSecurityMonitoringHistsignals": { "tag": "Security Monitoring", "undo": { @@ -8546,6 +8655,49 @@ "type": "safe" } }, + "ListTagPolicies": { + "tag": "Tag Policies", + "undo": { + "type": "safe" + } + }, + "CreateTagPolicy": { + "tag": "Tag Policies", + "undo": { + "operationId": "DeleteTagPolicy", + "parameters": [ + { + "name": "policy_id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteTagPolicy": { + "tag": "Tag Policies", + "undo": { + "type": "idempotent" + } + }, + "GetTagPolicy": { + "tag": "Tag Policies", + "undo": { + "type": "safe" + } + }, + "UpdateTagPolicy": { + "tag": "Tag Policies", + "undo": { + "type": "idempotent" + } + }, + "GetTagPolicyScore": { + "tag": "Tag Policies", + "undo": { + "type": "safe" + } + }, "ListTagPipelinesRulesets": { "tag": "Cloud Cost Management", "undo": { diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 3081839fbe..ef6d1603d7 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -100,6 +100,7 @@ pub struct ApiInstances { pub v2_api_dashboard_secure_embed: Option, pub v2_api_dashboards: Option, + pub v2_api_data_observability: Option, pub v2_api_datasets: Option, pub v2_api_data_deletion: Option, pub v2_api_deployment_gates: Option, @@ -110,6 +111,7 @@ pub struct ApiInstances { pub v2_api_events: Option, pub v2_api_feature_flags: Option, pub v2_api_forms: Option, + pub v2_api_organizations: Option, pub v2_api_high_availability_multi_region: Option, pub v2_api_entity_integration_configs: @@ -131,6 +133,7 @@ pub struct ApiInstances { Option, pub v2_api_service_now_integration: Option, + pub v2_api_slack_integration: Option, pub v2_api_statuspage_integration: Option, pub v2_api_webhooks_integration: @@ -164,7 +167,6 @@ pub struct ApiInstances { Option, pub v2_api_on_call: Option, pub v2_api_on_call_paging: Option, - pub v2_api_organizations: Option, pub v2_api_customer_org: Option, pub v2_api_org_connections: Option, pub v2_api_org_groups: Option, @@ -185,8 +187,6 @@ pub struct ApiInstances { pub v2_api_restriction_policies: Option, pub v2_api_rum: Option, - pub v2_api_rum_retention_filters_hardcoded: - Option, pub v2_api_rum_retention_filters: Option, pub v2_api_rum_metrics: Option, @@ -204,7 +204,6 @@ pub struct ApiInstances { pub v2_api_sensitive_data_scanner: Option, pub v2_api_service_accounts: Option, - pub v2_api_incident_services: Option, pub v2_api_service_definition: Option, pub v2_api_service_level_objectives: Option, @@ -214,6 +213,7 @@ pub struct ApiInstances { pub v2_api_status_pages: Option, pub v2_api_stegadography: Option, pub v2_api_synthetics: Option, + pub v2_api_tag_policies: Option, pub v2_api_teams: Option, pub v2_api_web_integrations: Option, pub v2_api_widgets: Option, @@ -411,6 +411,12 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { world.http_client.as_ref().unwrap().clone(), ), ); + world.api_instances.v2_api_slack_integration = Some( + datadogV2::api_slack_integration::SlackIntegrationAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); } "WebhooksIntegration" => { world.api_instances.v1_api_webhooks_integration = Some( @@ -826,6 +832,14 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { world.http_client.as_ref().unwrap().clone() )); } + "DataObservability" => { + world.api_instances.v2_api_data_observability = Some( + datadogV2::api_data_observability::DataObservabilityAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); + } "Datasets" => { world.api_instances.v2_api_datasets = Some( datadogV2::api_datasets::DatasetsAPI::with_client_and_config( @@ -1216,12 +1230,6 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { world.http_client.as_ref().unwrap().clone(), )); } - "RUMRetentionFiltersHardcoded" => { - world.api_instances.v2_api_rum_retention_filters_hardcoded = Some(datadogV2::api_rum_retention_filters_hardcoded::RUMRetentionFiltersHardcodedAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone() - )); - } "RumRetentionFilters" => { world.api_instances.v2_api_rum_retention_filters = Some(datadogV2::api_rum_retention_filters::RumRetentionFiltersAPI::with_client_and_config( world.config.clone(), @@ -1311,14 +1319,6 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ), ); } - "IncidentServices" => { - world.api_instances.v2_api_incident_services = Some( - datadogV2::api_incident_services::IncidentServicesAPI::with_client_and_config( - world.config.clone(), - world.http_client.as_ref().unwrap().clone(), - ), - ); - } "ServiceDefinition" => { world.api_instances.v2_api_service_definition = Some( datadogV2::api_service_definition::ServiceDefinitionAPI::with_client_and_config( @@ -1365,6 +1365,14 @@ pub fn initialize_api_instance(world: &mut DatadogWorld, api: String) { ), ); } + "TagPolicies" => { + world.api_instances.v2_api_tag_policies = Some( + datadogV2::api_tag_policies::TagPoliciesAPI::with_client_and_config( + world.config.clone(), + world.http_client.as_ref().unwrap().clone(), + ), + ); + } "Teams" => { world.api_instances.v2_api_teams = Some(datadogV2::api_teams::TeamsAPI::with_client_and_config( @@ -2425,6 +2433,46 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { world .function_mappings .insert("v2.SearchLLMObsSpans".into(), test_v2_search_llm_obs_spans); + world.function_mappings.insert( + "v2.ListLLMObsPatternsClusteredPoints".into(), + test_v2_list_llm_obs_patterns_clustered_points, + ); + world.function_mappings.insert( + "v2.ListLLMObsPatternsConfigs".into(), + test_v2_list_llm_obs_patterns_configs, + ); + world.function_mappings.insert( + "v2.UpsertLLMObsPatternsConfig".into(), + test_v2_upsert_llm_obs_patterns_config, + ); + world.function_mappings.insert( + "v2.GetLLMObsPatternsConfig".into(), + test_v2_get_llm_obs_patterns_config, + ); + world.function_mappings.insert( + "v2.DeleteLLMObsPatternsConfig".into(), + test_v2_delete_llm_obs_patterns_config, + ); + world.function_mappings.insert( + "v2.ListLLMObsPatternsRuns".into(), + test_v2_list_llm_obs_patterns_runs, + ); + world.function_mappings.insert( + "v2.TriggerLLMObsPatterns".into(), + test_v2_trigger_llm_obs_patterns, + ); + world.function_mappings.insert( + "v2.GetLLMObsPatternsRunStatus".into(), + test_v2_get_llm_obs_patterns_run_status, + ); + world.function_mappings.insert( + "v2.ListLLMObsPatternsTopics".into(), + test_v2_list_llm_obs_patterns_topics, + ); + world.function_mappings.insert( + "v2.ListLLMObsPatternsTopicsWithClusteredPoints".into(), + test_v2_list_llm_obs_patterns_topics_with_clustered_points, + ); world.function_mappings.insert( "v2.ListLLMObsDatasets".into(), test_v2_list_llm_obs_datasets, @@ -3716,6 +3764,10 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.ConvertExistingSecurityMonitoringRule".into(), test_v2_convert_existing_security_monitoring_rule, ); + world.function_mappings.insert( + "v2.RestoreSecurityMonitoringRule".into(), + test_v2_restore_security_monitoring_rule, + ); world.function_mappings.insert( "v2.TestExistingSecurityMonitoringRule".into(), test_v2_test_existing_security_monitoring_rule, @@ -4330,6 +4382,14 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { world .function_mappings .insert("v2.GetDashboardUsage".into(), test_v2_get_dashboard_usage); + world.function_mappings.insert( + "v2.GetDataObservabilityMonitorRunStatus".into(), + test_v2_get_data_observability_monitor_run_status, + ); + world.function_mappings.insert( + "v2.RunDataObservabilityMonitor".into(), + test_v2_run_data_observability_monitor, + ); world .function_mappings .insert("v2.GetAllDatasets".into(), test_v2_get_all_datasets); @@ -4611,6 +4671,48 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.UpsertAndPublishFormVersion".into(), test_v2_upsert_and_publish_form_version, ); + world + .function_mappings + .insert("v2.ListGlobalOrgs".into(), test_v2_list_global_orgs); + world.function_mappings.insert( + "v2.ListGlobalOrgsWithPagination".into(), + test_v2_list_global_orgs_with_pagination, + ); + world.function_mappings.insert( + "v2.UpdateLoginOrgConfigsMaxSessionDuration".into(), + test_v2_update_login_org_configs_max_session_duration, + ); + world + .function_mappings + .insert("v2.ListOrgs".into(), test_v2_list_orgs); + world.function_mappings.insert( + "v2.UpdateOrgSamlConfigurations".into(), + test_v2_update_org_saml_configurations, + ); + world + .function_mappings + .insert("v2.ListOrgConfigs".into(), test_v2_list_org_configs); + world + .function_mappings + .insert("v2.GetOrgConfig".into(), test_v2_get_org_config); + world + .function_mappings + .insert("v2.UpdateOrgConfig".into(), test_v2_update_org_config); + world.function_mappings.insert( + "v2.ListSAMLConfigurations".into(), + test_v2_list_saml_configurations, + ); + world + .function_mappings + .insert("v2.UploadIdPMetadata".into(), test_v2_upload_idp_metadata); + world.function_mappings.insert( + "v2.GetSAMLConfiguration".into(), + test_v2_get_saml_configuration, + ); + world.function_mappings.insert( + "v2.UpdateSAMLConfiguration".into(), + test_v2_update_saml_configuration, + ); world.function_mappings.insert( "v2.GetHamrOrgConnection".into(), test_v2_get_hamr_org_connection, @@ -4937,10 +5039,30 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { world .function_mappings .insert("v2.MakeGCPSTSDelegate".into(), test_v2_make_gcpsts_delegate); + world.function_mappings.insert( + "v2.ListGoogleChatOrganizations".into(), + test_v2_list_google_chat_organizations, + ); world.function_mappings.insert( "v2.GetSpaceByDisplayName".into(), test_v2_get_space_by_display_name, ); + world.function_mappings.insert( + "v2.DeleteGoogleChatOrganization".into(), + test_v2_delete_google_chat_organization, + ); + world.function_mappings.insert( + "v2.GetGoogleChatOrganization".into(), + test_v2_get_google_chat_organization, + ); + world.function_mappings.insert( + "v2.DeleteGoogleChatDelegatedUser".into(), + test_v2_delete_google_chat_delegated_user, + ); + world.function_mappings.insert( + "v2.GetGoogleChatDelegatedUser".into(), + test_v2_get_google_chat_delegated_user, + ); world.function_mappings.insert( "v2.ListOrganizationHandles".into(), test_v2_list_organization_handles, @@ -4961,6 +5083,26 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.UpdateOrganizationHandle".into(), test_v2_update_organization_handle, ); + world.function_mappings.insert( + "v2.ListGoogleChatTargetAudiences".into(), + test_v2_list_google_chat_target_audiences, + ); + world.function_mappings.insert( + "v2.CreateGoogleChatTargetAudience".into(), + test_v2_create_google_chat_target_audience, + ); + world.function_mappings.insert( + "v2.DeleteGoogleChatTargetAudience".into(), + test_v2_delete_google_chat_target_audience, + ); + world.function_mappings.insert( + "v2.GetGoogleChatTargetAudience".into(), + test_v2_get_google_chat_target_audience, + ); + world.function_mappings.insert( + "v2.UpdateGoogleChatTargetAudience".into(), + test_v2_update_google_chat_target_audience, + ); world .function_mappings .insert("v2.ListJiraAccounts".into(), test_v2_list_jira_accounts); @@ -5010,6 +5152,10 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.UpdateTenantBasedHandle".into(), test_v2_update_tenant_based_handle, ); + world.function_mappings.insert( + "v2.DeleteMSTeamsUserBinding".into(), + test_v2_delete_ms_teams_user_binding, + ); world.function_mappings.insert( "v2.ListWorkflowsWebhookHandles".into(), test_v2_list_workflows_webhook_handles, @@ -5147,6 +5293,10 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.ListServiceNowUsers".into(), test_v2_list_service_now_users, ); + world.function_mappings.insert( + "v2.ListSlackUserBindings".into(), + test_v2_list_slack_user_bindings, + ); world.function_mappings.insert( "v2.DeleteStatuspageAccount".into(), test_v2_delete_statuspage_account, @@ -5859,37 +6009,6 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { world .function_mappings .insert("v2.ResolveOnCallPage".into(), test_v2_resolve_on_call_page); - world - .function_mappings - .insert("v2.ListOrgs".into(), test_v2_list_orgs); - world.function_mappings.insert( - "v2.UpdateOrgSamlConfigurations".into(), - test_v2_update_org_saml_configurations, - ); - world - .function_mappings - .insert("v2.ListOrgConfigs".into(), test_v2_list_org_configs); - world - .function_mappings - .insert("v2.GetOrgConfig".into(), test_v2_get_org_config); - world - .function_mappings - .insert("v2.UpdateOrgConfig".into(), test_v2_update_org_config); - world.function_mappings.insert( - "v2.ListSAMLConfigurations".into(), - test_v2_list_saml_configurations, - ); - world - .function_mappings - .insert("v2.UploadIdPMetadata".into(), test_v2_upload_idp_metadata); - world.function_mappings.insert( - "v2.GetSAMLConfiguration".into(), - test_v2_get_saml_configuration, - ); - world.function_mappings.insert( - "v2.UpdateSAMLConfiguration".into(), - test_v2_update_saml_configuration, - ); world .function_mappings .insert("v2.DisableCustomerOrg".into(), test_v2_disable_customer_org); @@ -6357,18 +6476,6 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.GetServiceRepositoryInfo".into(), test_v2_get_service_repository_info, ); - world.function_mappings.insert( - "v2.ListHardcodedRetentionFilters".into(), - test_v2_list_hardcoded_retention_filters, - ); - world.function_mappings.insert( - "v2.GetHardcodedRetentionFilter".into(), - test_v2_get_hardcoded_retention_filter, - ); - world.function_mappings.insert( - "v2.UpdateHardcodedRetentionFilter".into(), - test_v2_update_hardcoded_retention_filter, - ); world.function_mappings.insert( "v2.OrderRetentionFilters".into(), test_v2_order_retention_filters, @@ -6653,25 +6760,6 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.UpdateServiceAccountApplicationKey".into(), test_v2_update_service_account_application_key, ); - world.function_mappings.insert( - "v2.ListIncidentServices".into(), - test_v2_list_incident_services, - ); - world.function_mappings.insert( - "v2.CreateIncidentService".into(), - test_v2_create_incident_service, - ); - world.function_mappings.insert( - "v2.DeleteIncidentService".into(), - test_v2_delete_incident_service, - ); - world - .function_mappings - .insert("v2.GetIncidentService".into(), test_v2_get_incident_service); - world.function_mappings.insert( - "v2.UpdateIncidentService".into(), - test_v2_update_incident_service, - ); world.function_mappings.insert( "v2.ListServiceDefinitions".into(), test_v2_list_service_definitions, @@ -7069,6 +7157,24 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v2.PatchGlobalVariable".into(), test_v2_patch_global_variable, ); + world + .function_mappings + .insert("v2.ListTagPolicies".into(), test_v2_list_tag_policies); + world + .function_mappings + .insert("v2.CreateTagPolicy".into(), test_v2_create_tag_policy); + world + .function_mappings + .insert("v2.DeleteTagPolicy".into(), test_v2_delete_tag_policy); + world + .function_mappings + .insert("v2.GetTagPolicy".into(), test_v2_get_tag_policy); + world + .function_mappings + .insert("v2.UpdateTagPolicy".into(), test_v2_update_tag_policy); + world + .function_mappings + .insert("v2.GetTagPolicyScore".into(), test_v2_get_tag_policy_score); world .function_mappings .insert("v2.ListTeams".into(), test_v2_list_teams); @@ -16133,6 +16239,315 @@ fn test_v2_search_llm_obs_spans(world: &mut DatadogWorld, _parameters: &HashMap< world.response.code = response.status.as_u16(); } +fn test_v2_list_llm_obs_patterns_clustered_points( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let topic_id = serde_json::from_value(_parameters.get("topic_id").unwrap().clone()).unwrap(); + let page_size = _parameters + .get("page_size") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let page_token = _parameters + .get("page_token") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = + datadogV2::api_llm_observability::ListLLMObsPatternsClusteredPointsOptionalParams::default( + ); + params.page_size = page_size; + params.page_token = page_token; + let response = + match block_on(api.list_llm_obs_patterns_clustered_points_with_http_info(topic_id, params)) + { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_llm_obs_patterns_configs( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.list_llm_obs_patterns_configs_with_http_info()) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_upsert_llm_obs_patterns_config( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.upsert_llm_obs_patterns_config_with_http_info(body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_llm_obs_patterns_config( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.get_llm_obs_patterns_config_with_http_info()) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_delete_llm_obs_patterns_config( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let config_id = serde_json::from_value(_parameters.get("config_id").unwrap().clone()).unwrap(); + let response = match block_on(api.delete_llm_obs_patterns_config_with_http_info(config_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_llm_obs_patterns_runs( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let config_id = serde_json::from_value(_parameters.get("config_id").unwrap().clone()).unwrap(); + let response = match block_on(api.list_llm_obs_patterns_runs_with_http_info(config_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_trigger_llm_obs_patterns( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.trigger_llm_obs_patterns_with_http_info(body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_llm_obs_patterns_run_status( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let config_id = serde_json::from_value(_parameters.get("config_id").unwrap().clone()).unwrap(); + let response = match block_on(api.get_llm_obs_patterns_run_status_with_http_info(config_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_llm_obs_patterns_topics( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let config_id = serde_json::from_value(_parameters.get("config_id").unwrap().clone()).unwrap(); + let run_id = _parameters + .get("run_id") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = + datadogV2::api_llm_observability::ListLLMObsPatternsTopicsOptionalParams::default(); + params.run_id = run_id; + let response = + match block_on(api.list_llm_obs_patterns_topics_with_http_info(config_id, params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_llm_obs_patterns_topics_with_clustered_points( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_llm_observability + .as_ref() + .expect("api instance not found"); + let config_id = serde_json::from_value(_parameters.get("config_id").unwrap().clone()).unwrap(); + let run_id = _parameters + .get("run_id") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let include_metrics = _parameters + .get("include_metrics") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_llm_observability::ListLLMObsPatternsTopicsWithClusteredPointsOptionalParams::default(); + params.run_id = run_id; + params.include_metrics = include_metrics; + let response = match block_on( + api.list_llm_obs_patterns_topics_with_clustered_points_with_http_info(config_id, params), + ) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_list_llm_obs_datasets(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -27527,6 +27942,36 @@ fn test_v2_convert_existing_security_monitoring_rule( world.response.code = response.status.as_u16(); } +fn test_v2_restore_security_monitoring_rule( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_security_monitoring + .as_ref() + .expect("api instance not found"); + let rule_id = serde_json::from_value(_parameters.get("rule_id").unwrap().clone()).unwrap(); + let version = serde_json::from_value(_parameters.get("version").unwrap().clone()).unwrap(); + let response = + match block_on(api.restore_security_monitoring_rule_with_http_info(rule_id, version)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_test_existing_security_monitoring_rule( world: &mut DatadogWorld, _parameters: &HashMap, @@ -31114,9 +31559,13 @@ fn test_v2_list_cost_tag_key_sources( let filter_provider = _parameters .get("filter[provider]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let filter_metric = _parameters + .get("filter[metric]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = datadogV2::api_cloud_cost_management::ListCostTagKeySourcesOptionalParams::default(); params.filter_provider = filter_provider; + params.filter_metric = filter_metric; let response = match block_on(api.list_cost_tag_key_sources_with_http_info(filter_month, params)) { Ok(response) => response, @@ -32905,6 +33354,64 @@ fn test_v2_get_dashboard_usage(world: &mut DatadogWorld, _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_data_observability + .as_ref() + .expect("api instance not found"); + let run_id = serde_json::from_value(_parameters.get("run_id").unwrap().clone()).unwrap(); + let response = + match block_on(api.get_data_observability_monitor_run_status_with_http_info(run_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_run_data_observability_monitor( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_data_observability + .as_ref() + .expect("api instance not found"); + let monitor_id = + serde_json::from_value(_parameters.get("monitor_id").unwrap().clone()).unwrap(); + let response = match block_on(api.run_data_observability_monitor_with_http_info(monitor_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_get_all_datasets(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -35268,6 +35775,369 @@ fn test_v2_upsert_and_publish_form_version( world.response.code = response.status.as_u16(); } +fn test_v2_list_global_orgs(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let user_handle = + serde_json::from_value(_parameters.get("user_handle").unwrap().clone()).unwrap(); + let page_limit = _parameters + .get("page[limit]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let page_cursor = _parameters + .get("page[cursor]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_organizations::ListGlobalOrgsOptionalParams::default(); + params.page_limit = page_limit; + params.page_cursor = page_cursor; + let response = match block_on(api.list_global_orgs_with_http_info(user_handle, params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} +fn test_v2_list_global_orgs_with_pagination( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let user_handle = + serde_json::from_value(_parameters.get("user_handle").unwrap().clone()).unwrap(); + let page_limit = _parameters + .get("page[limit]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let page_cursor = _parameters + .get("page[cursor]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_organizations::ListGlobalOrgsOptionalParams::default(); + params.page_limit = page_limit; + params.page_cursor = page_cursor; + let response = api.list_global_orgs_with_pagination(user_handle, params); + let mut result = Vec::new(); + + block_on(async { + pin_mut!(response); + + while let Some(resp) = response.next().await { + match resp { + Ok(response) => { + result.push(response); + } + Err(error) => { + return match error { + Error::ResponseError(e) => { + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {}", error), + }; + } + } + } + }); + world.response.object = serde_json::to_value(result).unwrap(); + world.response.code = 200; +} + +fn test_v2_update_login_org_configs_max_session_duration( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = + match block_on(api.update_login_org_configs_max_session_duration_with_http_info(body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_orgs(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let filter_name = _parameters + .get("filter[name]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_organizations::ListOrgsOptionalParams::default(); + params.filter_name = filter_name; + let response = match block_on(api.list_orgs_with_http_info(params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_update_org_saml_configurations( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.update_org_saml_configurations_with_http_info(body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_org_configs(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.list_org_configs_with_http_info()) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_org_config(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let org_config_name = + serde_json::from_value(_parameters.get("org_config_name").unwrap().clone()).unwrap(); + let response = match block_on(api.get_org_config_with_http_info(org_config_name)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_update_org_config(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let org_config_name = + serde_json::from_value(_parameters.get("org_config_name").unwrap().clone()).unwrap(); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.update_org_config_with_http_info(org_config_name, body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_list_saml_configurations( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.list_saml_configurations_with_http_info()) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_upload_idp_metadata(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let idp_file = _parameters.get("idp_file").and_then(|param| { + std::fs::read(format!( + "tests/scenarios/features/v{}/{}", + world.api_version, + param.as_str().unwrap() + )) + .ok() + }); + let mut params = datadogV2::api_organizations::UploadIdPMetadataOptionalParams::default(); + params.idp_file = idp_file; + let response = match block_on(api.upload_idp_metadata_with_http_info(params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_saml_configuration(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let saml_config_uuid = + serde_json::from_value(_parameters.get("saml_config_uuid").unwrap().clone()).unwrap(); + let response = match block_on(api.get_saml_configuration_with_http_info(saml_config_uuid)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_update_saml_configuration( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_organizations + .as_ref() + .expect("api instance not found"); + let saml_config_uuid = + serde_json::from_value(_parameters.get("saml_config_uuid").unwrap().clone()).unwrap(); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = + match block_on(api.update_saml_configuration_with_http_info(saml_config_uuid, body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_get_hamr_org_connection(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -37970,6 +38840,33 @@ fn test_v2_make_gcpsts_delegate(world: &mut DatadogWorld, _parameters: &HashMap< world.response.code = response.status.as_u16(); } +fn test_v2_list_google_chat_organizations( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.list_google_chat_organizations_with_http_info()) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_get_space_by_display_name( world: &mut DatadogWorld, _parameters: &HashMap, @@ -38003,6 +38900,133 @@ fn test_v2_get_space_by_display_name( world.response.code = response.status.as_u16(); } +fn test_v2_delete_google_chat_organization( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let response = + match block_on(api.delete_google_chat_organization_with_http_info(organization_binding_id)) + { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_google_chat_organization( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let response = + match block_on(api.get_google_chat_organization_with_http_info(organization_binding_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_delete_google_chat_delegated_user( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let response = match block_on( + api.delete_google_chat_delegated_user_with_http_info(organization_binding_id), + ) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_google_chat_delegated_user( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let response = match block_on( + api.get_google_chat_delegated_user_with_http_info(organization_binding_id), + ) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_list_organization_handles( world: &mut DatadogWorld, _parameters: &HashMap, @@ -38166,6 +39190,178 @@ fn test_v2_update_organization_handle( world.response.code = response.status.as_u16(); } +fn test_v2_list_google_chat_target_audiences( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let response = match block_on( + api.list_google_chat_target_audiences_with_http_info(organization_binding_id), + ) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_create_google_chat_target_audience( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on( + api.create_google_chat_target_audience_with_http_info(organization_binding_id, body), + ) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_delete_google_chat_target_audience( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let target_audience_id = + serde_json::from_value(_parameters.get("target_audience_id").unwrap().clone()).unwrap(); + let response = match block_on(api.delete_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + )) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_google_chat_target_audience( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let target_audience_id = + serde_json::from_value(_parameters.get("target_audience_id").unwrap().clone()).unwrap(); + let response = match block_on(api.get_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + )) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_update_google_chat_target_audience( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_google_chat_integration + .as_ref() + .expect("api instance not found"); + let organization_binding_id = + serde_json::from_value(_parameters.get("organization_binding_id").unwrap().clone()) + .unwrap(); + let target_audience_id = + serde_json::from_value(_parameters.get("target_audience_id").unwrap().clone()).unwrap(); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.update_google_chat_target_audience_with_http_info( + organization_binding_id, + target_audience_id, + body, + )) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_list_jira_accounts(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -38538,6 +39734,34 @@ fn test_v2_update_tenant_based_handle( world.response.code = response.status.as_u16(); } +fn test_v2_delete_ms_teams_user_binding( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_microsoft_teams_integration + .as_ref() + .expect("api instance not found"); + let tenant_id = serde_json::from_value(_parameters.get("tenant_id").unwrap().clone()).unwrap(); + let response = match block_on(api.delete_ms_teams_user_binding_with_http_info(tenant_id)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_list_workflows_webhook_handles( world: &mut DatadogWorld, _parameters: &HashMap, @@ -39497,6 +40721,34 @@ fn test_v2_list_service_now_users(world: &mut DatadogWorld, _parameters: &HashMa world.response.code = response.status.as_u16(); } +fn test_v2_list_slack_user_bindings( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_slack_integration + .as_ref() + .expect("api instance not found"); + let user_uuid = serde_json::from_value(_parameters.get("user_uuid").unwrap().clone()).unwrap(); + let response = match block_on(api.list_slack_user_bindings_with_http_info(user_uuid)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_delete_statuspage_account( world: &mut DatadogWorld, _parameters: &HashMap, @@ -45379,258 +46631,6 @@ fn test_v2_resolve_on_call_page(world: &mut DatadogWorld, _parameters: &HashMap< world.response.code = response.status.as_u16(); } -fn test_v2_list_orgs(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let filter_name = _parameters - .get("filter[name]") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api_organizations::ListOrgsOptionalParams::default(); - params.filter_name = filter_name; - let response = match block_on(api.list_orgs_with_http_info(params)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_update_org_saml_configurations( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.update_org_saml_configurations_with_http_info(body)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_list_org_configs(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let response = match block_on(api.list_org_configs_with_http_info()) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_get_org_config(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let org_config_name = - serde_json::from_value(_parameters.get("org_config_name").unwrap().clone()).unwrap(); - let response = match block_on(api.get_org_config_with_http_info(org_config_name)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_update_org_config(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let org_config_name = - serde_json::from_value(_parameters.get("org_config_name").unwrap().clone()).unwrap(); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.update_org_config_with_http_info(org_config_name, body)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_list_saml_configurations( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let response = match block_on(api.list_saml_configurations_with_http_info()) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_upload_idp_metadata(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let idp_file = _parameters.get("idp_file").and_then(|param| { - std::fs::read(format!( - "tests/scenarios/features/v{}/{}", - world.api_version, - param.as_str().unwrap() - )) - .ok() - }); - let mut params = datadogV2::api_organizations::UploadIdPMetadataOptionalParams::default(); - params.idp_file = idp_file; - let response = match block_on(api.upload_idp_metadata_with_http_info(params)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_get_saml_configuration(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let saml_config_uuid = - serde_json::from_value(_parameters.get("saml_config_uuid").unwrap().clone()).unwrap(); - let response = match block_on(api.get_saml_configuration_with_http_info(saml_config_uuid)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_update_saml_configuration( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_organizations - .as_ref() - .expect("api instance not found"); - let saml_config_uuid = - serde_json::from_value(_parameters.get("saml_config_uuid").unwrap().clone()).unwrap(); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = - match block_on(api.update_saml_configuration_with_http_info(saml_config_uuid, body)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - fn test_v2_disable_customer_org(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -49769,95 +50769,6 @@ fn test_v2_get_service_repository_info( world.response.code = response.status.as_u16(); } -fn test_v2_list_hardcoded_retention_filters( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_rum_retention_filters_hardcoded - .as_ref() - .expect("api instance not found"); - let app_id = serde_json::from_value(_parameters.get("app_id").unwrap().clone()).unwrap(); - let response = match block_on(api.list_hardcoded_retention_filters_with_http_info(app_id)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_get_hardcoded_retention_filter( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_rum_retention_filters_hardcoded - .as_ref() - .expect("api instance not found"); - let app_id = serde_json::from_value(_parameters.get("app_id").unwrap().clone()).unwrap(); - let rf_id = serde_json::from_value(_parameters.get("rf_id").unwrap().clone()).unwrap(); - let response = match block_on(api.get_hardcoded_retention_filter_with_http_info(app_id, rf_id)) - { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_update_hardcoded_retention_filter( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_rum_retention_filters_hardcoded - .as_ref() - .expect("api instance not found"); - let app_id = serde_json::from_value(_parameters.get("app_id").unwrap().clone()).unwrap(); - let rf_id = serde_json::from_value(_parameters.get("rf_id").unwrap().clone()).unwrap(); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = - match block_on(api.update_hardcoded_retention_filter_with_http_info(app_id, rf_id, body)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - fn test_v2_order_retention_filters(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances @@ -52059,201 +52970,13 @@ fn test_v2_list_service_account_access_tokens( .get("filter") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api_service_accounts::ListServiceAccountAccessTokensOptionalParams::default(); - params.page_size = page_size; - params.page_number = page_number; - params.sort = sort; - params.filter = filter; - let response = match block_on( - api.list_service_account_access_tokens_with_http_info(service_account_id, params), - ) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_create_service_account_access_token( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_service_accounts - .as_ref() - .expect("api instance not found"); - let service_account_id = - serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on( - api.create_service_account_access_token_with_http_info(service_account_id, body), - ) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_revoke_service_account_access_token( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_service_accounts - .as_ref() - .expect("api instance not found"); - let service_account_id = - serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); - let response = match block_on( - api.revoke_service_account_access_token_with_http_info(service_account_id, token_id), - ) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_get_service_account_access_token( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_service_accounts - .as_ref() - .expect("api instance not found"); - let service_account_id = - serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); - let response = match block_on( - api.get_service_account_access_token_with_http_info(service_account_id, token_id), - ) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_update_service_account_access_token( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_service_accounts - .as_ref() - .expect("api instance not found"); - let service_account_id = - serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); - let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.update_service_account_access_token_with_http_info( - service_account_id, - token_id, - body, - )) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - -fn test_v2_list_service_account_application_keys( - world: &mut DatadogWorld, - _parameters: &HashMap, -) { - let api = world - .api_instances - .v2_api_service_accounts - .as_ref() - .expect("api instance not found"); - let service_account_id = - serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let page_size = _parameters - .get("page[size]") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let page_number = _parameters - .get("page[number]") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let sort = _parameters - .get("sort") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let filter = _parameters - .get("filter") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let filter_created_at_start = _parameters - .get("filter[created_at][start]") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let filter_created_at_end = _parameters - .get("filter[created_at][end]") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV2::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams::default(); + datadogV2::api_service_accounts::ListServiceAccountAccessTokensOptionalParams::default(); params.page_size = page_size; params.page_number = page_number; params.sort = sort; params.filter = filter; - params.filter_created_at_start = filter_created_at_start; - params.filter_created_at_end = filter_created_at_end; let response = match block_on( - api.list_service_account_application_keys_with_http_info(service_account_id, params), + api.list_service_account_access_tokens_with_http_info(service_account_id, params), ) { Ok(response) => response, Err(error) => { @@ -52272,7 +52995,7 @@ fn test_v2_list_service_account_application_keys( world.response.code = response.status.as_u16(); } -fn test_v2_create_service_account_application_key( +fn test_v2_create_service_account_access_token( world: &mut DatadogWorld, _parameters: &HashMap, ) { @@ -52285,7 +53008,7 @@ fn test_v2_create_service_account_application_key( serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); let response = match block_on( - api.create_service_account_application_key_with_http_info(service_account_id, body), + api.create_service_account_access_token_with_http_info(service_account_id, body), ) { Ok(response) => response, Err(error) => { @@ -52304,7 +53027,7 @@ fn test_v2_create_service_account_application_key( world.response.code = response.status.as_u16(); } -fn test_v2_delete_service_account_application_key( +fn test_v2_revoke_service_account_access_token( world: &mut DatadogWorld, _parameters: &HashMap, ) { @@ -52315,10 +53038,9 @@ fn test_v2_delete_service_account_application_key( .expect("api instance not found"); let service_account_id = serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let app_key_id = - serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); + let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); let response = match block_on( - api.delete_service_account_application_key_with_http_info(service_account_id, app_key_id), + api.revoke_service_account_access_token_with_http_info(service_account_id, token_id), ) { Ok(response) => response, Err(error) => { @@ -52337,7 +53059,7 @@ fn test_v2_delete_service_account_application_key( world.response.code = response.status.as_u16(); } -fn test_v2_get_service_account_application_key( +fn test_v2_get_service_account_access_token( world: &mut DatadogWorld, _parameters: &HashMap, ) { @@ -52348,10 +53070,9 @@ fn test_v2_get_service_account_application_key( .expect("api instance not found"); let service_account_id = serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let app_key_id = - serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); + let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); let response = match block_on( - api.get_service_account_application_key_with_http_info(service_account_id, app_key_id), + api.get_service_account_access_token_with_http_info(service_account_id, token_id), ) { Ok(response) => response, Err(error) => { @@ -52370,7 +53091,7 @@ fn test_v2_get_service_account_application_key( world.response.code = response.status.as_u16(); } -fn test_v2_update_service_account_application_key( +fn test_v2_update_service_account_access_token( world: &mut DatadogWorld, _parameters: &HashMap, ) { @@ -52381,12 +53102,11 @@ fn test_v2_update_service_account_application_key( .expect("api instance not found"); let service_account_id = serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); - let app_key_id = - serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); + let token_id = serde_json::from_value(_parameters.get("token_id").unwrap().clone()).unwrap(); let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.update_service_account_application_key_with_http_info( + let response = match block_on(api.update_service_account_access_token_with_http_info( service_account_id, - app_key_id, + token_id, body, )) { Ok(response) => response, @@ -52406,31 +53126,46 @@ fn test_v2_update_service_account_application_key( world.response.code = response.status.as_u16(); } -fn test_v2_list_incident_services(world: &mut DatadogWorld, _parameters: &HashMap) { +fn test_v2_list_service_account_application_keys( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { let api = world .api_instances - .v2_api_incident_services + .v2_api_service_accounts .as_ref() .expect("api instance not found"); - let include = _parameters - .get("include") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let service_account_id = + serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); let page_size = _parameters .get("page[size]") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let page_offset = _parameters - .get("page[offset]") + let page_number = _parameters + .get("page[number]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let sort = _parameters + .get("sort") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let filter = _parameters .get("filter") .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let filter_created_at_start = _parameters + .get("filter[created_at][start]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let filter_created_at_end = _parameters + .get("filter[created_at][end]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); let mut params = - datadogV2::api_incident_services::ListIncidentServicesOptionalParams::default(); - params.include = include; + datadogV2::api_service_accounts::ListServiceAccountApplicationKeysOptionalParams::default(); params.page_size = page_size; - params.page_offset = page_offset; + params.page_number = page_number; + params.sort = sort; params.filter = filter; - let response = match block_on(api.list_incident_services_with_http_info(params)) { + params.filter_created_at_start = filter_created_at_start; + params.filter_created_at_end = filter_created_at_end; + let response = match block_on( + api.list_service_account_application_keys_with_http_info(service_account_id, params), + ) { Ok(response) => response, Err(error) => { return match error { @@ -52448,14 +53183,21 @@ fn test_v2_list_incident_services(world: &mut DatadogWorld, _parameters: &HashMa world.response.code = response.status.as_u16(); } -fn test_v2_create_incident_service(world: &mut DatadogWorld, _parameters: &HashMap) { +fn test_v2_create_service_account_application_key( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { let api = world .api_instances - .v2_api_incident_services + .v2_api_service_accounts .as_ref() .expect("api instance not found"); + let service_account_id = + serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.create_incident_service_with_http_info(body)) { + let response = match block_on( + api.create_service_account_application_key_with_http_info(service_account_id, body), + ) { Ok(response) => response, Err(error) => { return match error { @@ -52473,15 +53215,22 @@ fn test_v2_create_incident_service(world: &mut DatadogWorld, _parameters: &HashM world.response.code = response.status.as_u16(); } -fn test_v2_delete_incident_service(world: &mut DatadogWorld, _parameters: &HashMap) { +fn test_v2_delete_service_account_application_key( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { let api = world .api_instances - .v2_api_incident_services + .v2_api_service_accounts .as_ref() .expect("api instance not found"); - let service_id = - serde_json::from_value(_parameters.get("service_id").unwrap().clone()).unwrap(); - let response = match block_on(api.delete_incident_service_with_http_info(service_id)) { + let service_account_id = + serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); + let app_key_id = + serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); + let response = match block_on( + api.delete_service_account_application_key_with_http_info(service_account_id, app_key_id), + ) { Ok(response) => response, Err(error) => { return match error { @@ -52499,20 +53248,22 @@ fn test_v2_delete_incident_service(world: &mut DatadogWorld, _parameters: &HashM world.response.code = response.status.as_u16(); } -fn test_v2_get_incident_service(world: &mut DatadogWorld, _parameters: &HashMap) { +fn test_v2_get_service_account_application_key( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { let api = world .api_instances - .v2_api_incident_services + .v2_api_service_accounts .as_ref() .expect("api instance not found"); - let service_id = - serde_json::from_value(_parameters.get("service_id").unwrap().clone()).unwrap(); - let include = _parameters - .get("include") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = datadogV2::api_incident_services::GetIncidentServiceOptionalParams::default(); - params.include = include; - let response = match block_on(api.get_incident_service_with_http_info(service_id, params)) { + let service_account_id = + serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); + let app_key_id = + serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); + let response = match block_on( + api.get_service_account_application_key_with_http_info(service_account_id, app_key_id), + ) { Ok(response) => response, Err(error) => { return match error { @@ -52530,16 +53281,25 @@ fn test_v2_get_incident_service(world: &mut DatadogWorld, _parameters: &HashMap< world.response.code = response.status.as_u16(); } -fn test_v2_update_incident_service(world: &mut DatadogWorld, _parameters: &HashMap) { +fn test_v2_update_service_account_application_key( + world: &mut DatadogWorld, + _parameters: &HashMap, +) { let api = world .api_instances - .v2_api_incident_services + .v2_api_service_accounts .as_ref() .expect("api instance not found"); - let service_id = - serde_json::from_value(_parameters.get("service_id").unwrap().clone()).unwrap(); + let service_account_id = + serde_json::from_value(_parameters.get("service_account_id").unwrap().clone()).unwrap(); + let app_key_id = + serde_json::from_value(_parameters.get("app_key_id").unwrap().clone()).unwrap(); let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); - let response = match block_on(api.update_incident_service_with_http_info(service_id, body)) { + let response = match block_on(api.update_service_account_application_key_with_http_info( + service_account_id, + app_key_id, + body, + )) { Ok(response) => response, Err(error) => { return match error { @@ -56066,6 +56826,208 @@ fn test_v2_patch_global_variable(world: &mut DatadogWorld, _parameters: &HashMap world.response.code = response.status.as_u16(); } +fn test_v2_list_tag_policies(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let include_disabled = _parameters + .get("include_disabled") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let include_deleted = _parameters + .get("include_deleted") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let include = _parameters + .get("include") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let filter_source = _parameters + .get("filter[source]") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let ts_start = _parameters + .get("ts_start") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let ts_end = _parameters + .get("ts_end") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_tag_policies::ListTagPoliciesOptionalParams::default(); + params.include_disabled = include_disabled; + params.include_deleted = include_deleted; + params.include = include; + params.filter_source = filter_source; + params.ts_start = ts_start; + params.ts_end = ts_end; + let response = match block_on(api.list_tag_policies_with_http_info(params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_create_tag_policy(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.create_tag_policy_with_http_info(body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_delete_tag_policy(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let policy_id = serde_json::from_value(_parameters.get("policy_id").unwrap().clone()).unwrap(); + let hard_delete = _parameters + .get("hard_delete") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_tag_policies::DeleteTagPolicyOptionalParams::default(); + params.hard_delete = hard_delete; + let response = match block_on(api.delete_tag_policy_with_http_info(policy_id, params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_tag_policy(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let policy_id = serde_json::from_value(_parameters.get("policy_id").unwrap().clone()).unwrap(); + let include = _parameters + .get("include") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let ts_start = _parameters + .get("ts_start") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let ts_end = _parameters + .get("ts_end") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_tag_policies::GetTagPolicyOptionalParams::default(); + params.include = include; + params.ts_start = ts_start; + params.ts_end = ts_end; + let response = match block_on(api.get_tag_policy_with_http_info(policy_id, params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_update_tag_policy(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let policy_id = serde_json::from_value(_parameters.get("policy_id").unwrap().clone()).unwrap(); + let body = serde_json::from_value(_parameters.get("body").unwrap().clone()).unwrap(); + let response = match block_on(api.update_tag_policy_with_http_info(policy_id, body)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + +fn test_v2_get_tag_policy_score(world: &mut DatadogWorld, _parameters: &HashMap) { + let api = world + .api_instances + .v2_api_tag_policies + .as_ref() + .expect("api instance not found"); + let policy_id = serde_json::from_value(_parameters.get("policy_id").unwrap().clone()).unwrap(); + let ts_start = _parameters + .get("ts_start") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let ts_end = _parameters + .get("ts_end") + .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); + let mut params = datadogV2::api_tag_policies::GetTagPolicyScoreOptionalParams::default(); + params.ts_start = ts_start; + params.ts_end = ts_end; + let response = match block_on(api.get_tag_policy_score_with_http_info(policy_id, params)) { + Ok(response) => response, + Err(error) => { + return match error { + Error::ResponseError(e) => { + world.response.code = e.status.as_u16(); + if let Some(entity) = e.entity { + world.response.object = serde_json::to_value(entity).unwrap(); + } + } + _ => panic!("error parsing response: {error}"), + }; + } + }; + world.response.object = serde_json::to_value(response.entity).unwrap(); + world.response.code = response.status.as_u16(); +} + fn test_v2_list_teams(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances