From 6eeecddf323a4bc051276c8c7ae6ad61a7d6d022 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 4 Mar 2026 02:30:24 +0000 Subject: [PATCH] Regenerate client from commit 2920812 of spec repo --- .generator/schemas/v1/openapi.yaml | 550 +--------------- .generator/schemas/v2/openapi.yaml | 71 ++ ...sage-metering_GetHourlyUsageAttribution.rs | 3 +- ...age-metering_GetMonthlyUsageAttribution.rs | 3 +- ...g_GetMonthlyUsageAttribution_3849653599.rs | 3 +- ...usage-metering_GetUsageAttributionTypes.rs | 15 + src/datadogV1/api/api_usage_metering.rs | 33 +- src/datadogV1/model/mod.rs | 4 - .../model_hourly_usage_attribution_body.rs | 21 +- ...del_hourly_usage_attribution_usage_type.rs | 324 ---------- .../model_monthly_usage_attribution_body.rs | 1 - ...hly_usage_attribution_supported_metrics.rs | 612 ------------------ .../model_monthly_usage_attribution_values.rs | 1 - src/datadogV2/api/api_usage_metering.rs | 117 ++++ src/datadogV2/model/mod.rs | 8 + ...odel_usage_attribution_types_attributes.rs | 105 +++ .../model_usage_attribution_types_body.rs | 152 +++++ .../model_usage_attribution_types_response.rs | 105 +++ .../model_usage_attribution_types_type.rs | 48 ++ tests/scenarios/features/v2/undo.json | 6 + .../features/v2/usage_metering.feature | 6 + tests/scenarios/function_mappings.rs | 31 + 22 files changed, 717 insertions(+), 1502 deletions(-) create mode 100644 examples/v2_usage-metering_GetUsageAttributionTypes.rs delete mode 100644 src/datadogV1/model/model_hourly_usage_attribution_usage_type.rs delete mode 100644 src/datadogV1/model/model_monthly_usage_attribution_supported_metrics.rs create mode 100644 src/datadogV2/model/model_usage_attribution_types_attributes.rs create mode 100644 src/datadogV2/model/model_usage_attribution_types_body.rs create mode 100644 src/datadogV2/model/model_usage_attribution_types_response.rs create mode 100644 src/datadogV2/model/model_usage_attribution_types_type.rs diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 7b7153fb2..eebd3cd9b 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4508,177 +4508,9 @@ components: HourlyUsageAttributionUsageType: description: 'Supported products for hourly usage attribution requests. - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_ingested_spans_usage`.' - enum: - - api_usage - - apm_fargate_usage - - apm_host_usage - - apm_usm_usage - - appsec_fargate_usage - - appsec_usage - - asm_serverless_traced_invocations_usage - - asm_serverless_traced_invocations_percentage - - bits_ai_investigations_usage - - browser_usage - - ci_pipeline_indexed_spans_usage - - ci_test_indexed_spans_usage - - ci_visibility_itr_usage - - cloud_siem_usage - - code_security_host_usage - - container_excl_agent_usage - - container_usage - - cspm_containers_usage - - cspm_hosts_usage - - custom_event_usage - - custom_ingested_timeseries_usage - - custom_timeseries_usage - - cws_containers_usage - - cws_fargate_task_usage - - cws_hosts_usage - - data_jobs_monitoring_usage - - data_stream_monitoring_usage - - dbm_hosts_usage - - dbm_queries_usage - - error_tracking_usage - - error_tracking_percentage - - estimated_indexed_spans_usage - - estimated_ingested_spans_usage - - fargate_usage - - flex_logs_starter - - flex_stored_logs - - functions_usage - - incident_management_monthly_active_users_usage - - indexed_spans_usage - - infra_host_usage - - ingested_logs_bytes_usage - - ingested_spans_bytes_usage - - invocations_usage - - lambda_traced_invocations_usage - - llm_observability_usage - - llm_spans_usage - - logs_indexed_15day_usage - - logs_indexed_180day_usage - - logs_indexed_1day_usage - - logs_indexed_30day_usage - - logs_indexed_360day_usage - - logs_indexed_3day_usage - - logs_indexed_45day_usage - - logs_indexed_60day_usage - - logs_indexed_7day_usage - - logs_indexed_90day_usage - - logs_indexed_custom_retention_usage - - mobile_app_testing_usage - - ndm_netflow_usage - - npm_host_usage - - network_device_wireless_usage - - obs_pipeline_bytes_usage - - obs_pipelines_vcpu_usage - - online_archive_usage - - product_analytics_session_usage - - profiled_container_usage - - profiled_fargate_usage - - profiled_host_usage - - published_app - - rum_browser_mobile_sessions_usage - - rum_ingested_usage - - rum_investigate_usage - - rum_replay_sessions_usage - - rum_session_replay_add_on_usage - - sca_fargate_usage - - sds_scanned_bytes_usage - - serverless_apps_usage - - siem_analyzed_logs_add_on_usage - - siem_ingested_bytes_usage - - snmp_usage - - universal_service_monitoring_usage - - vuln_management_hosts_usage - - workflow_executions_usage - type: string - x-enum-varnames: - - API_USAGE - - APM_FARGATE_USAGE - - APM_HOST_USAGE - - APM_USM_USAGE - - APPSEC_FARGATE_USAGE - - APPSEC_USAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - - BITS_AI_INVESTIGATIONS_USAGE - - BROWSER_USAGE - - CI_PIPELINE_INDEXED_SPANS_USAGE - - CI_TEST_INDEXED_SPANS_USAGE - - CI_VISIBILITY_ITR_USAGE - - CLOUD_SIEM_USAGE - - CODE_SECURITY_HOST_USAGE - - CONTAINER_EXCL_AGENT_USAGE - - CONTAINER_USAGE - - CSPM_CONTAINERS_USAGE - - CSPM_HOSTS_USAGE - - CUSTOM_EVENT_USAGE - - CUSTOM_INGESTED_TIMESERIES_USAGE - - CUSTOM_TIMESERIES_USAGE - - CWS_CONTAINERS_USAGE - - CWS_FARGATE_TASK_USAGE - - CWS_HOSTS_USAGE - - DATA_JOBS_MONITORING_USAGE - - DATA_STREAM_MONITORING_USAGE - - DBM_HOSTS_USAGE - - DBM_QUERIES_USAGE - - ERROR_TRACKING_USAGE - - ERROR_TRACKING_PERCENTAGE - - ESTIMATED_INDEXED_SPANS_USAGE - - ESTIMATED_INGESTED_SPANS_USAGE - - FARGATE_USAGE - - FLEX_LOGS_STARTER - - FLEX_STORED_LOGS - - FUNCTIONS_USAGE - - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE - - INDEXED_SPANS_USAGE - - INFRA_HOST_USAGE - - INGESTED_LOGS_BYTES_USAGE - - INGESTED_SPANS_BYTES_USAGE - - INVOCATIONS_USAGE - - LAMBDA_TRACED_INVOCATIONS_USAGE - - LLM_OBSERVABILITY_USAGE - - LLM_SPANS_USAGE - - LOGS_INDEXED_15DAY_USAGE - - LOGS_INDEXED_180DAY_USAGE - - LOGS_INDEXED_1DAY_USAGE - - LOGS_INDEXED_30DAY_USAGE - - LOGS_INDEXED_360DAY_USAGE - - LOGS_INDEXED_3DAY_USAGE - - LOGS_INDEXED_45DAY_USAGE - - LOGS_INDEXED_60DAY_USAGE - - LOGS_INDEXED_7DAY_USAGE - - LOGS_INDEXED_90DAY_USAGE - - LOGS_INDEXED_CUSTOM_RETENTION_USAGE - - MOBILE_APP_TESTING_USAGE - - NDM_NETFLOW_USAGE - - NETWORK_DEVICE_WIRELESS_USAGE - - NPM_HOST_USAGE - - OBS_PIPELINE_BYTES_USAGE - - OBS_PIPELINE_VCPU_USAGE - - ONLINE_ARCHIVE_USAGE - - PRODUCT_ANALYTICS_SESSION_USAGE - - PROFILED_CONTAINER_USAGE - - PROFILED_FARGATE_USAGE - - PROFILED_HOST_USAGE - - PUBLISHED_APP_USAGE - - RUM_BROWSER_MOBILE_SESSIONS_USAGE - - RUM_INGESTED_USAGE - - RUM_INVESTIGATE_USAGE - - RUM_REPLAY_SESSIONS_USAGE - - RUM_SESSION_REPLAY_ADD_ON_USAGE - - SCA_FARGATE_USAGE - - SDS_SCANNED_BYTES_USAGE - - SERVERLESS_APPS_USAGE - - SIEM_ANALYZED_LOGS_ADD_ON_USAGE - - SIEM_INGESTED_BYTES_USAGE - - SNMP_USAGE - - UNIVERSAL_SERVICE_MONITORING_USAGE - - VULN_MANAGEMENT_HOSTS_USAGE - - WORKFLOW_EXECUTIONS_USAGE + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' + type: string IFrameWidgetDefinition: description: The iframe widget allows you to embed a portion of any other web page on your dashboard. Only available on FREE layout dashboards. @@ -9059,341 +8891,13 @@ components: type: array type: object MonthlyUsageAttributionSupportedMetrics: - description: Supported metrics for monthly usage attribution requests. - enum: - - api_usage - - api_percentage - - apm_fargate_usage - - apm_fargate_percentage - - appsec_fargate_usage - - appsec_fargate_percentage - - apm_host_usage - - apm_host_percentage - - apm_usm_usage - - apm_usm_percentage - - appsec_usage - - appsec_percentage - - asm_serverless_traced_invocations_usage - - asm_serverless_traced_invocations_percentage - - bits_ai_investigations_usage - - bits_ai_investigations_percentage - - browser_usage - - browser_percentage - - ci_visibility_itr_usage - - ci_visibility_itr_percentage - - cloud_siem_usage - - cloud_siem_percentage - - code_security_host_usage - - code_security_host_percentage - - container_excl_agent_usage - - container_excl_agent_percentage - - container_usage - - container_percentage - - cspm_containers_percentage - - cspm_containers_usage - - cspm_hosts_percentage - - cspm_hosts_usage - - custom_timeseries_usage - - custom_timeseries_percentage - - custom_ingested_timeseries_usage - - custom_ingested_timeseries_percentage - - cws_containers_percentage - - cws_containers_usage - - cws_fargate_task_percentage - - cws_fargate_task_usage - - cws_hosts_percentage - - cws_hosts_usage - - data_jobs_monitoring_usage - - data_jobs_monitoring_percentage - - data_stream_monitoring_usage - - data_stream_monitoring_percentage - - dbm_hosts_percentage - - dbm_hosts_usage - - dbm_queries_percentage - - dbm_queries_usage - - error_tracking_usage - - error_tracking_percentage - - estimated_indexed_spans_usage - - estimated_indexed_spans_percentage - - estimated_ingested_spans_usage - - estimated_ingested_spans_percentage - - fargate_usage - - fargate_percentage - - flex_logs_starter_usage - - flex_logs_starter_percentage - - flex_stored_logs_usage - - flex_stored_logs_percentage - - functions_usage - - functions_percentage - - incident_management_monthly_active_users_usage - - incident_management_monthly_active_users_percentage - - infra_host_usage - - infra_host_percentage - - invocations_usage - - invocations_percentage - - lambda_traced_invocations_usage - - lambda_traced_invocations_percentage - - llm_observability_usage - - llm_observability_percentage - - llm_spans_usage - - llm_spans_percentage - - mobile_app_testing_percentage - - mobile_app_testing_usage - - ndm_netflow_usage - - ndm_netflow_percentage - - network_device_wireless_usage - - network_device_wireless_percentage - - npm_host_usage - - npm_host_percentage - - obs_pipeline_bytes_usage - - obs_pipeline_bytes_percentage - - obs_pipelines_vcpu_usage - - obs_pipelines_vcpu_percentage - - online_archive_usage - - online_archive_percentage - - product_analytics_session_usage - - product_analytics_session_percentage - - profiled_container_usage - - profiled_container_percentage - - profiled_fargate_usage - - profiled_fargate_percentage - - profiled_host_usage - - profiled_host_percentage - - published_app_usage - - published_app_percentage - - serverless_apps_usage - - serverless_apps_percentage - - snmp_usage - - snmp_percentage - - universal_service_monitoring_usage - - universal_service_monitoring_percentage - - vuln_management_hosts_usage - - vuln_management_hosts_percentage - - sds_scanned_bytes_usage - - sds_scanned_bytes_percentage - - ci_test_indexed_spans_usage - - ci_test_indexed_spans_percentage - - ingested_logs_bytes_usage - - ingested_logs_bytes_percentage - - ci_pipeline_indexed_spans_usage - - ci_pipeline_indexed_spans_percentage - - indexed_spans_usage - - indexed_spans_percentage - - custom_event_usage - - custom_event_percentage - - logs_indexed_custom_retention_usage - - logs_indexed_custom_retention_percentage - - logs_indexed_360day_usage - - logs_indexed_360day_percentage - - logs_indexed_180day_usage - - logs_indexed_180day_percentage - - logs_indexed_90day_usage - - logs_indexed_90day_percentage - - logs_indexed_60day_usage - - logs_indexed_60day_percentage - - logs_indexed_45day_usage - - logs_indexed_45day_percentage - - logs_indexed_30day_usage - - logs_indexed_30day_percentage - - logs_indexed_15day_usage - - logs_indexed_15day_percentage - - logs_indexed_7day_usage - - logs_indexed_7day_percentage - - logs_indexed_3day_usage - - logs_indexed_3day_percentage - - logs_indexed_1day_usage - - logs_indexed_1day_percentage - - rum_ingested_usage - - rum_ingested_percentage - - rum_investigate_usage - - rum_investigate_percentage - - rum_replay_sessions_usage - - rum_replay_sessions_percentage - - rum_session_replay_add_on_usage - - rum_session_replay_add_on_percentage - - rum_browser_mobile_sessions_usage - - rum_browser_mobile_sessions_percentage - - ingested_spans_bytes_usage - - ingested_spans_bytes_percentage - - siem_analyzed_logs_add_on_usage - - siem_analyzed_logs_add_on_percentage - - siem_ingested_bytes_usage - - siem_ingested_bytes_percentage - - workflow_executions_usage - - workflow_executions_percentage - - sca_fargate_usage - - sca_fargate_percentage - - '*' - type: string - x-enum-varnames: - - API_USAGE - - API_PERCENTAGE - - APM_FARGATE_USAGE - - APM_FARGATE_PERCENTAGE - - APPSEC_FARGATE_USAGE - - APPSEC_FARGATE_PERCENTAGE - - APM_HOST_USAGE - - APM_HOST_PERCENTAGE - - APM_USM_USAGE - - APM_USM_PERCENTAGE - - APPSEC_USAGE - - APPSEC_PERCENTAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - - BITS_AI_INVESTIGATIONS_USAGE - - BITS_AI_INVESTIGATIONS_PERCENTAGE - - BROWSER_USAGE - - BROWSER_PERCENTAGE - - CI_VISIBILITY_ITR_USAGE - - CI_VISIBILITY_ITR_PERCENTAGE - - CLOUD_SIEM_USAGE - - CLOUD_SIEM_PERCENTAGE - - CODE_SECURITY_HOST_USAGE - - CODE_SECURITY_HOST_PERCENTAGE - - CONTAINER_EXCL_AGENT_USAGE - - CONTAINER_EXCL_AGENT_PERCENTAGE - - CONTAINER_USAGE - - CONTAINER_PERCENTAGE - - CSPM_CONTAINERS_PERCENTAGE - - CSPM_CONTAINERS_USAGE - - CSPM_HOSTS_PERCENTAGE - - CSPM_HOSTS_USAGE - - CUSTOM_TIMESERIES_USAGE - - CUSTOM_TIMESERIES_PERCENTAGE - - CUSTOM_INGESTED_TIMESERIES_USAGE - - CUSTOM_INGESTED_TIMESERIES_PERCENTAGE - - CWS_CONTAINERS_PERCENTAGE - - CWS_CONTAINERS_USAGE - - CWS_FARGATE_TASK_PERCENTAGE - - CWS_FARGATE_TASK_USAGE - - CWS_HOSTS_PERCENTAGE - - CWS_HOSTS_USAGE - - DATA_JOBS_MONITORING_USAGE - - DATA_JOBS_MONITORING_PERCENTAGE - - DATA_STREAM_MONITORING_USAGE - - DATA_STREAM_MONITORING_PERCENTAGE - - DBM_HOSTS_PERCENTAGE - - DBM_HOSTS_USAGE - - DBM_QUERIES_PERCENTAGE - - DBM_QUERIES_USAGE - - ERROR_TRACKING_USAGE - - ERROR_TRACKING_PERCENTAGE - - ESTIMATED_INDEXED_SPANS_USAGE - - ESTIMATED_INDEXED_SPANS_PERCENTAGE - - ESTIMATED_INGESTED_SPANS_USAGE - - ESTIMATED_INGESTED_SPANS_PERCENTAGE - - FARGATE_USAGE - - FARGATE_PERCENTAGE - - FLEX_LOGS_STARTER_USAGE - - FLEX_LOGS_STARTER_PERCENTAGE - - FLEX_STORED_LOGS_USAGE - - FLEX_STORED_LOGS_PERCENTAGE - - FUNCTIONS_USAGE - - FUNCTIONS_PERCENTAGE - - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE - - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_PERCENTAGE - - INFRA_HOST_USAGE - - INFRA_HOST_PERCENTAGE - - INVOCATIONS_USAGE - - INVOCATIONS_PERCENTAGE - - LAMBDA_TRACED_INVOCATIONS_USAGE - - LAMBDA_TRACED_INVOCATIONS_PERCENTAGE - - LLM_OBSERVABILITY_USAGE - - LLM_OBSERVABILITY_PERCENTAGE - - LLM_SPANS_USAGE - - LLM_SPANS_PERCENTAGE - - MOBILE_APP_TESTING_USAGE - - MOBILE_APP_TESTING_PERCENTAGE - - NDM_NETFLOW_USAGE - - NDM_NETFLOW_PERCENTAGE - - NETWORK_DEVICE_WIRELESS_USAGE - - NETWORK_DEVICE_WIRELESS_PERCENTAGE - - NPM_HOST_USAGE - - NPM_HOST_PERCENTAGE - - OBS_PIPELINE_BYTES_USAGE - - OBS_PIPELINE_BYTES_PERCENTAGE - - OBS_PIPELINES_VCPU_USAGE - - OBS_PIPELINES_VCPU_PERCENTAGE - - ONLINE_ARCHIVE_USAGE - - ONLINE_ARCHIVE_PERCENTAGE - - PRODUCT_ANALYTICS_SESSION_USAGE - - PRODUCT_ANALYTICS_SESSION_PERCENTAGE - - PROFILED_CONTAINER_USAGE - - PROFILED_CONTAINER_PERCENTAGE - - PROFILED_FARGATE_USAGE - - PROFILED_FARGATE_PERCENTAGE - - PROFILED_HOST_USAGE - - PROFILED_HOST_PERCENTAGE - - PUBLISHED_APP_USAGE - - PUBLISHED_APP_PERCENTAGE - - SERVERLESS_APPS_USAGE - - SERVERLESS_APPS_PERCENTAGE - - SNMP_USAGE - - SNMP_PERCENTAGE - - UNIVERSAL_SERVICE_MONITORING_USAGE - - UNIVERSAL_SERVICE_MONITORING_PERCENTAGE - - VULN_MANAGEMENT_HOSTS_USAGE - - VULN_MANAGEMENT_HOSTS_PERCENTAGE - - SDS_SCANNED_BYTES_USAGE - - SDS_SCANNED_BYTES_PERCENTAGE - - CI_TEST_INDEXED_SPANS_USAGE - - CI_TEST_INDEXED_SPANS_PERCENTAGE - - INGESTED_LOGS_BYTES_USAGE - - INGESTED_LOGS_BYTES_PERCENTAGE - - CI_PIPELINE_INDEXED_SPANS_USAGE - - CI_PIPELINE_INDEXED_SPANS_PERCENTAGE - - INDEXED_SPANS_USAGE - - INDEXED_SPANS_PERCENTAGE - - CUSTOM_EVENT_USAGE - - CUSTOM_EVENT_PERCENTAGE - - LOGS_INDEXED_CUSTOM_RETENTION_USAGE - - LOGS_INDEXED_CUSTOM_RETENTION_PERCENTAGE - - LOGS_INDEXED_360DAY_USAGE - - LOGS_INDEXED_360DAY_PERCENTAGE - - LOGS_INDEXED_180DAY_USAGE - - LOGS_INDEXED_180DAY_PERCENTAGE - - LOGS_INDEXED_90DAY_USAGE - - LOGS_INDEXED_90DAY_PERCENTAGE - - LOGS_INDEXED_60DAY_USAGE - - LOGS_INDEXED_60DAY_PERCENTAGE - - LOGS_INDEXED_45DAY_USAGE - - LOGS_INDEXED_45DAY_PERCENTAGE - - LOGS_INDEXED_30DAY_USAGE - - LOGS_INDEXED_30DAY_PERCENTAGE - - LOGS_INDEXED_15DAY_USAGE - - LOGS_INDEXED_15DAY_PERCENTAGE - - LOGS_INDEXED_7DAY_USAGE - - LOGS_INDEXED_7DAY_PERCENTAGE - - LOGS_INDEXED_3DAY_USAGE - - LOGS_INDEXED_3DAY_PERCENTAGE - - LOGS_INDEXED_1DAY_USAGE - - LOGS_INDEXED_1DAY_PERCENTAGE - - RUM_INGESTED_USAGE - - RUM_INGESTED_PERCENTAGE - - RUM_INVESTIGATE_USAGE - - RUM_INVESTIGATE_PERCENTAGE - - RUM_REPLAY_SESSIONS_USAGE - - RUM_REPLAY_SESSIONS_PERCENTAGE - - RUM_SESSION_REPLAY_ADD_ON_USAGE - - RUM_SESSION_REPLAY_ADD_ON_PERCENTAGE - - RUM_BROWSER_MOBILE_SESSIONS_USAGE - - RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE - - INGESTED_SPANS_BYTES_USAGE - - INGESTED_SPANS_BYTES_PERCENTAGE - - SIEM_ANALYZED_LOGS_ADD_ON_USAGE - - SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE - - SIEM_INGESTED_BYTES_USAGE - - SIEM_INGESTED_BYTES_PERCENTAGE - - WORKFLOW_EXECUTIONS_USAGE - - WORKFLOW_EXECUTIONS_PERCENTAGE - - SCA_FARGATE_USAGE - - SCA_FARGATE_PERCENTAGE - - ALL - MonthlyUsageAttributionValues: - description: 'Fields in Usage Summary by tag(s). + description: 'Supported metrics for monthly usage attribution requests. - The following values have been **deprecated**: `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`.' + To obtain the complete list of valid usage types, make a request to the [Get + usage attribution types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' + type: string + MonthlyUsageAttributionValues: + description: Fields in Usage Summary by tag(s). properties: api_percentage: description: The percentage of synthetic API test usage by tag(s). @@ -37273,10 +36777,7 @@ paths: code example:\n\n```\nresponse := GetHourlyUsageAttribution(start_month)\ncursor := response.metadata.pagination.next_record_id\nWHILE cursor != null BEGIN\n \ sleep(5 seconds) # Avoid running into rate limit\n response := GetHourlyUsageAttribution(start_month, - next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```\nThe - following values have been **deprecated**:\n `estimated_indexed_spans_usage`, - `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`, - `llm_observability_usage`, `llm_observability_percentage`." + next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```" operationId: GetHourlyUsageAttribution parameters: - description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` @@ -37297,9 +36798,14 @@ paths: schema: format: date-time type: string - - description: 'Usage type to retrieve. The following values have been **deprecated**: + - description: 'Usage type to retrieve. Usage types are in the format `_usage`. - `estimated_indexed_spans_usage`, `estimated_ingested_spans_usage`.' + Example: `infra_host_usage` + + To obtain the complete list of active usage types that can be used to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: usage_type required: true @@ -37852,10 +37358,15 @@ paths: - description: 'Comma-separated list of usage types to return, or `*` for all usage types. - The following values have been **deprecated**: + Usage types are in the format `_usage` and `_percentage`. + + Example: `infra_host_usage,infra_host_percentage` - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`, `llm_observability_usage`, `llm_observability_percentage`.' + To obtain the complete list of usage attribution types that can be used + to replace + + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: fields required: true @@ -37867,12 +37378,15 @@ paths: required: false schema: $ref: '#/components/schemas/UsageSortDirection' - - description: 'The field to sort by. + - description: 'The field to sort by. Sort fields are in the format `_usage`. + + Example: `infra_host_usage` - The following values have been **deprecated**: + To obtain the complete list of usage attribution types that can be used + to replace - `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, - `estimated_ingested_spans_percentage`.' + `` in the field names, make a request to the [Get usage attribution + types API](https://docs.datadoghq.com/api/latest/usage-metering/#get-usage-attribution-types).' in: query name: sort_name required: false diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index d3b9ce53d..d6cecb92c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -69185,6 +69185,42 @@ components: usage_type: $ref: '#/components/schemas/HourlyUsageType' type: object + UsageAttributionTypesAttributes: + description: List of usage attribution types. + properties: + values: + description: List of usage attribution types. + items: + description: A given usage type in a list. + example: infra_host + type: string + type: array + type: object + UsageAttributionTypesBody: + description: Usage attribution types data. + properties: + attributes: + $ref: '#/components/schemas/UsageAttributionTypesAttributes' + id: + description: Unique ID of the response. + type: string + type: + $ref: '#/components/schemas/UsageAttributionTypesType' + type: object + UsageAttributionTypesResponse: + description: Usage attribution types response. + properties: + data: + $ref: '#/components/schemas/UsageAttributionTypesBody' + type: object + UsageAttributionTypesType: + default: usage_attribution_types + description: Type of usage attribution types data. + enum: + - usage_attribution_types + type: string + x-enum-varnames: + - USAGE_ATTRIBUTION_TYPES UsageDataObject: description: Usage data. properties: @@ -107057,6 +107093,41 @@ paths: permissions: - usage_read - billing_read + /api/v2/usage/usage-attribution-types: + get: + description: Get usage attribution types. + operationId: GetUsageAttributionTypes + responses: + '200': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/UsageAttributionTypesResponse' + description: OK + '403': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden - User is not authorized + '429': + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Too many requests + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - usage_read + summary: Get usage attribution types + tags: + - Usage Metering + x-permission: + operator: OR + permissions: + - usage_read /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. diff --git a/examples/v1_usage-metering_GetHourlyUsageAttribution.rs b/examples/v1_usage-metering_GetHourlyUsageAttribution.rs index ad2ef3707..4bca4e392 100644 --- a/examples/v1_usage-metering_GetHourlyUsageAttribution.rs +++ b/examples/v1_usage-metering_GetHourlyUsageAttribution.rs @@ -3,7 +3,6 @@ use chrono::{DateTime, Utc}; use datadog_api_client::datadog; use datadog_api_client::datadogV1::api_usage_metering::GetHourlyUsageAttributionOptionalParams; use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; -use datadog_api_client::datadogV1::model::HourlyUsageAttributionUsageType; #[tokio::main] async fn main() { @@ -14,7 +13,7 @@ async fn main() { DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00") .expect("Failed to parse datetime") .with_timezone(&Utc), - HourlyUsageAttributionUsageType::INFRA_HOST_USAGE, + "infra_host_usage".to_string(), GetHourlyUsageAttributionOptionalParams::default(), ) .await; diff --git a/examples/v1_usage-metering_GetMonthlyUsageAttribution.rs b/examples/v1_usage-metering_GetMonthlyUsageAttribution.rs index 57b1a4336..1ee43233b 100644 --- a/examples/v1_usage-metering_GetMonthlyUsageAttribution.rs +++ b/examples/v1_usage-metering_GetMonthlyUsageAttribution.rs @@ -3,7 +3,6 @@ use chrono::{DateTime, Utc}; use datadog_api_client::datadog; use datadog_api_client::datadogV1::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; -use datadog_api_client::datadogV1::model::MonthlyUsageAttributionSupportedMetrics; #[tokio::main] async fn main() { @@ -14,7 +13,7 @@ async fn main() { DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00") .expect("Failed to parse datetime") .with_timezone(&Utc), - MonthlyUsageAttributionSupportedMetrics::INFRA_HOST_USAGE, + "infra_host_usage".to_string(), GetMonthlyUsageAttributionOptionalParams::default(), ) .await; diff --git a/examples/v1_usage-metering_GetMonthlyUsageAttribution_3849653599.rs b/examples/v1_usage-metering_GetMonthlyUsageAttribution_3849653599.rs index e1d613f29..c8e533427 100644 --- a/examples/v1_usage-metering_GetMonthlyUsageAttribution_3849653599.rs +++ b/examples/v1_usage-metering_GetMonthlyUsageAttribution_3849653599.rs @@ -3,7 +3,6 @@ use chrono::{DateTime, Utc}; use datadog_api_client::datadog; use datadog_api_client::datadogV1::api_usage_metering::GetMonthlyUsageAttributionOptionalParams; use datadog_api_client::datadogV1::api_usage_metering::UsageMeteringAPI; -use datadog_api_client::datadogV1::model::MonthlyUsageAttributionSupportedMetrics; #[tokio::main] async fn main() { @@ -17,7 +16,7 @@ async fn main() { DateTime::parse_from_rfc3339("2021-11-08T11:11:11+00:00") .expect("Failed to parse datetime") .with_timezone(&Utc), - MonthlyUsageAttributionSupportedMetrics::INFRA_HOST_USAGE, + "infra_host_usage".to_string(), GetMonthlyUsageAttributionOptionalParams::default().next_record_id( monthly_usage_attribution_metadata_pagination_next_record_id.clone(), ), diff --git a/examples/v2_usage-metering_GetUsageAttributionTypes.rs b/examples/v2_usage-metering_GetUsageAttributionTypes.rs new file mode 100644 index 000000000..160b5ab1c --- /dev/null +++ b/examples/v2_usage-metering_GetUsageAttributionTypes.rs @@ -0,0 +1,15 @@ +// Get usage attribution types returns "OK" response +use datadog_api_client::datadog; +use datadog_api_client::datadogV2::api_usage_metering::UsageMeteringAPI; + +#[tokio::main] +async fn main() { + let configuration = datadog::Configuration::new(); + let api = UsageMeteringAPI::with_config(configuration); + let resp = api.get_usage_attribution_types().await; + if let Ok(value) = resp { + println!("{:#?}", value); + } else { + println!("{:#?}", resp.unwrap_err()); + } +} diff --git a/src/datadogV1/api/api_usage_metering.rs b/src/datadogV1/api/api_usage_metering.rs index 99fa08564..48c2bd8c4 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -166,10 +166,11 @@ pub struct GetMonthlyUsageAttributionOptionalParams { pub end_month: Option>, /// The direction to sort by: `[desc, asc]`. pub sort_direction: Option, - /// The field to sort by. - /// The following values have been **deprecated**: - /// `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`. - pub sort_name: Option, + /// The field to sort by. Sort fields are in the format `_usage`. + /// Example: `infra_host_usage` + /// To obtain the complete list of usage attribution types that can be used to replace + /// `` in the field names, make a request to the [Get usage attribution types API](). + pub sort_name: Option, /// Comma separated list of tag keys used to group usage. If no value is provided the usage will not be broken down by tags. /// /// To see which tags are available, look for the value of `tag_config_source` in the API response. @@ -191,13 +192,11 @@ impl GetMonthlyUsageAttributionOptionalParams { self.sort_direction = Some(value); self } - /// The field to sort by. - /// The following values have been **deprecated**: - /// `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`. - pub fn sort_name( - mut self, - value: crate::datadogV1::model::MonthlyUsageAttributionSupportedMetrics, - ) -> Self { + /// The field to sort by. Sort fields are in the format `_usage`. + /// Example: `infra_host_usage` + /// To obtain the complete list of usage attribution types that can be used to replace + /// `` in the field names, make a request to the [Get usage attribution types API](). + pub fn sort_name(mut self, value: String) -> Self { self.sort_name = Some(value); self } @@ -1296,12 +1295,10 @@ impl UsageMeteringAPI { /// cursor := response.metadata.pagination.next_record_id /// END /// ``` - /// The following values have been **deprecated**: - /// `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`, `llm_observability_usage`, `llm_observability_percentage`. pub async fn get_hourly_usage_attribution( &self, start_hr: chrono::DateTime, - usage_type: crate::datadogV1::model::HourlyUsageAttributionUsageType, + usage_type: String, params: GetHourlyUsageAttributionOptionalParams, ) -> Result< crate::datadogV1::model::HourlyUsageAttributionResponse, @@ -1339,12 +1336,10 @@ impl UsageMeteringAPI { /// cursor := response.metadata.pagination.next_record_id /// END /// ``` - /// The following values have been **deprecated**: - /// `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`, `llm_observability_usage`, `llm_observability_percentage`. pub async fn get_hourly_usage_attribution_with_http_info( &self, start_hr: chrono::DateTime, - usage_type: crate::datadogV1::model::HourlyUsageAttributionUsageType, + usage_type: String, params: GetHourlyUsageAttributionOptionalParams, ) -> Result< datadog::ResponseContent, @@ -1881,7 +1876,7 @@ impl UsageMeteringAPI { pub async fn get_monthly_usage_attribution( &self, start_month: chrono::DateTime, - fields: crate::datadogV1::model::MonthlyUsageAttributionSupportedMetrics, + fields: String, params: GetMonthlyUsageAttributionOptionalParams, ) -> Result< crate::datadogV1::model::MonthlyUsageAttributionResponse, @@ -1922,7 +1917,7 @@ impl UsageMeteringAPI { pub async fn get_monthly_usage_attribution_with_http_info( &self, start_month: chrono::DateTime, - fields: crate::datadogV1::model::MonthlyUsageAttributionSupportedMetrics, + fields: String, params: GetMonthlyUsageAttributionOptionalParams, ) -> Result< datadog::ResponseContent, diff --git a/src/datadogV1/model/mod.rs b/src/datadogV1/model/mod.rs index db1d08973..506bf4bbc 100644 --- a/src/datadogV1/model/mod.rs +++ b/src/datadogV1/model/mod.rs @@ -1808,8 +1808,6 @@ pub mod model_usage_hosts_response; pub use self::model_usage_hosts_response::UsageHostsResponse; pub mod model_usage_host_hour; pub use self::model_usage_host_hour::UsageHostHour; -pub mod model_hourly_usage_attribution_usage_type; -pub use self::model_hourly_usage_attribution_usage_type::HourlyUsageAttributionUsageType; pub mod model_hourly_usage_attribution_response; pub use self::model_hourly_usage_attribution_response::HourlyUsageAttributionResponse; pub mod model_hourly_usage_attribution_metadata; @@ -1846,8 +1844,6 @@ pub mod model_usage_logs_by_index_response; pub use self::model_usage_logs_by_index_response::UsageLogsByIndexResponse; pub mod model_usage_logs_by_index_hour; pub use self::model_usage_logs_by_index_hour::UsageLogsByIndexHour; -pub mod model_monthly_usage_attribution_supported_metrics; -pub use self::model_monthly_usage_attribution_supported_metrics::MonthlyUsageAttributionSupportedMetrics; pub mod model_monthly_usage_attribution_response; pub use self::model_monthly_usage_attribution_response::MonthlyUsageAttributionResponse; pub mod model_monthly_usage_attribution_metadata; diff --git a/src/datadogV1/model/model_hourly_usage_attribution_body.rs b/src/datadogV1/model/model_hourly_usage_attribution_body.rs index bbc458916..758ba540a 100644 --- a/src/datadogV1/model/model_hourly_usage_attribution_body.rs +++ b/src/datadogV1/model/model_hourly_usage_attribution_body.rs @@ -40,9 +40,9 @@ pub struct HourlyUsageAttributionBody { #[serde(rename = "updated_at")] pub updated_at: Option, /// Supported products for hourly usage attribution requests. - /// The following values have been **deprecated**: `estimated_indexed_spans_usage`, `estimated_ingested_spans_usage`. + /// To obtain the complete list of valid usage types, make a request to the [Get usage attribution types API](). #[serde(rename = "usage_type")] - pub usage_type: Option, + pub usage_type: Option, #[serde(flatten)] pub additional_properties: std::collections::BTreeMap, #[serde(skip)] @@ -107,10 +107,7 @@ impl HourlyUsageAttributionBody { self } - pub fn usage_type( - mut self, - value: crate::datadogV1::model::HourlyUsageAttributionUsageType, - ) -> Self { + pub fn usage_type(mut self, value: String) -> Self { self.usage_type = Some(value); self } @@ -156,9 +153,7 @@ impl<'de> Deserialize<'de> for HourlyUsageAttributionBody { None; let mut total_usage_sum: Option = None; let mut updated_at: Option = None; - let mut usage_type: Option< - crate::datadogV1::model::HourlyUsageAttributionUsageType, - > = None; + let mut usage_type: Option = None; let mut additional_properties: std::collections::BTreeMap< String, serde_json::Value, @@ -219,14 +214,6 @@ impl<'de> Deserialize<'de> for HourlyUsageAttributionBody { continue; } usage_type = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - if let Some(ref _usage_type) = usage_type { - match _usage_type { - crate::datadogV1::model::HourlyUsageAttributionUsageType::UnparsedObject(_usage_type) => { - _unparsed = true; - }, - _ => {} - } - } } &_ => { if let Ok(value) = serde_json::from_value(v.clone()) { diff --git a/src/datadogV1/model/model_hourly_usage_attribution_usage_type.rs b/src/datadogV1/model/model_hourly_usage_attribution_usage_type.rs deleted file mode 100644 index 49decf4c8..000000000 --- a/src/datadogV1/model/model_hourly_usage_attribution_usage_type.rs +++ /dev/null @@ -1,324 +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, Serializer}; - -#[non_exhaustive] -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum HourlyUsageAttributionUsageType { - API_USAGE, - APM_FARGATE_USAGE, - APM_HOST_USAGE, - APM_USM_USAGE, - APPSEC_FARGATE_USAGE, - APPSEC_USAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE, - BITS_AI_INVESTIGATIONS_USAGE, - BROWSER_USAGE, - CI_PIPELINE_INDEXED_SPANS_USAGE, - CI_TEST_INDEXED_SPANS_USAGE, - CI_VISIBILITY_ITR_USAGE, - CLOUD_SIEM_USAGE, - CODE_SECURITY_HOST_USAGE, - CONTAINER_EXCL_AGENT_USAGE, - CONTAINER_USAGE, - CSPM_CONTAINERS_USAGE, - CSPM_HOSTS_USAGE, - CUSTOM_EVENT_USAGE, - CUSTOM_INGESTED_TIMESERIES_USAGE, - CUSTOM_TIMESERIES_USAGE, - CWS_CONTAINERS_USAGE, - CWS_FARGATE_TASK_USAGE, - CWS_HOSTS_USAGE, - DATA_JOBS_MONITORING_USAGE, - DATA_STREAM_MONITORING_USAGE, - DBM_HOSTS_USAGE, - DBM_QUERIES_USAGE, - ERROR_TRACKING_USAGE, - ERROR_TRACKING_PERCENTAGE, - ESTIMATED_INDEXED_SPANS_USAGE, - ESTIMATED_INGESTED_SPANS_USAGE, - FARGATE_USAGE, - FLEX_LOGS_STARTER, - FLEX_STORED_LOGS, - FUNCTIONS_USAGE, - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE, - INDEXED_SPANS_USAGE, - INFRA_HOST_USAGE, - INGESTED_LOGS_BYTES_USAGE, - INGESTED_SPANS_BYTES_USAGE, - INVOCATIONS_USAGE, - LAMBDA_TRACED_INVOCATIONS_USAGE, - LLM_OBSERVABILITY_USAGE, - LLM_SPANS_USAGE, - LOGS_INDEXED_15DAY_USAGE, - LOGS_INDEXED_180DAY_USAGE, - LOGS_INDEXED_1DAY_USAGE, - LOGS_INDEXED_30DAY_USAGE, - LOGS_INDEXED_360DAY_USAGE, - LOGS_INDEXED_3DAY_USAGE, - LOGS_INDEXED_45DAY_USAGE, - LOGS_INDEXED_60DAY_USAGE, - LOGS_INDEXED_7DAY_USAGE, - LOGS_INDEXED_90DAY_USAGE, - LOGS_INDEXED_CUSTOM_RETENTION_USAGE, - MOBILE_APP_TESTING_USAGE, - NDM_NETFLOW_USAGE, - NETWORK_DEVICE_WIRELESS_USAGE, - NPM_HOST_USAGE, - OBS_PIPELINE_BYTES_USAGE, - OBS_PIPELINE_VCPU_USAGE, - ONLINE_ARCHIVE_USAGE, - PRODUCT_ANALYTICS_SESSION_USAGE, - PROFILED_CONTAINER_USAGE, - PROFILED_FARGATE_USAGE, - PROFILED_HOST_USAGE, - PUBLISHED_APP_USAGE, - RUM_BROWSER_MOBILE_SESSIONS_USAGE, - RUM_INGESTED_USAGE, - RUM_INVESTIGATE_USAGE, - RUM_REPLAY_SESSIONS_USAGE, - RUM_SESSION_REPLAY_ADD_ON_USAGE, - SCA_FARGATE_USAGE, - SDS_SCANNED_BYTES_USAGE, - SERVERLESS_APPS_USAGE, - SIEM_ANALYZED_LOGS_ADD_ON_USAGE, - SIEM_INGESTED_BYTES_USAGE, - SNMP_USAGE, - UNIVERSAL_SERVICE_MONITORING_USAGE, - VULN_MANAGEMENT_HOSTS_USAGE, - WORKFLOW_EXECUTIONS_USAGE, - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl ToString for HourlyUsageAttributionUsageType { - fn to_string(&self) -> String { - match self { - Self::API_USAGE => String::from("api_usage"), - Self::APM_FARGATE_USAGE => String::from("apm_fargate_usage"), - Self::APM_HOST_USAGE => String::from("apm_host_usage"), - Self::APM_USM_USAGE => String::from("apm_usm_usage"), - Self::APPSEC_FARGATE_USAGE => String::from("appsec_fargate_usage"), - Self::APPSEC_USAGE => String::from("appsec_usage"), - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE => { - String::from("asm_serverless_traced_invocations_usage") - } - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE => { - String::from("asm_serverless_traced_invocations_percentage") - } - Self::BITS_AI_INVESTIGATIONS_USAGE => String::from("bits_ai_investigations_usage"), - Self::BROWSER_USAGE => String::from("browser_usage"), - Self::CI_PIPELINE_INDEXED_SPANS_USAGE => { - String::from("ci_pipeline_indexed_spans_usage") - } - Self::CI_TEST_INDEXED_SPANS_USAGE => String::from("ci_test_indexed_spans_usage"), - Self::CI_VISIBILITY_ITR_USAGE => String::from("ci_visibility_itr_usage"), - Self::CLOUD_SIEM_USAGE => String::from("cloud_siem_usage"), - Self::CODE_SECURITY_HOST_USAGE => String::from("code_security_host_usage"), - Self::CONTAINER_EXCL_AGENT_USAGE => String::from("container_excl_agent_usage"), - Self::CONTAINER_USAGE => String::from("container_usage"), - Self::CSPM_CONTAINERS_USAGE => String::from("cspm_containers_usage"), - Self::CSPM_HOSTS_USAGE => String::from("cspm_hosts_usage"), - Self::CUSTOM_EVENT_USAGE => String::from("custom_event_usage"), - Self::CUSTOM_INGESTED_TIMESERIES_USAGE => { - String::from("custom_ingested_timeseries_usage") - } - Self::CUSTOM_TIMESERIES_USAGE => String::from("custom_timeseries_usage"), - Self::CWS_CONTAINERS_USAGE => String::from("cws_containers_usage"), - Self::CWS_FARGATE_TASK_USAGE => String::from("cws_fargate_task_usage"), - Self::CWS_HOSTS_USAGE => String::from("cws_hosts_usage"), - Self::DATA_JOBS_MONITORING_USAGE => String::from("data_jobs_monitoring_usage"), - Self::DATA_STREAM_MONITORING_USAGE => String::from("data_stream_monitoring_usage"), - Self::DBM_HOSTS_USAGE => String::from("dbm_hosts_usage"), - Self::DBM_QUERIES_USAGE => String::from("dbm_queries_usage"), - Self::ERROR_TRACKING_USAGE => String::from("error_tracking_usage"), - Self::ERROR_TRACKING_PERCENTAGE => String::from("error_tracking_percentage"), - Self::ESTIMATED_INDEXED_SPANS_USAGE => String::from("estimated_indexed_spans_usage"), - Self::ESTIMATED_INGESTED_SPANS_USAGE => String::from("estimated_ingested_spans_usage"), - Self::FARGATE_USAGE => String::from("fargate_usage"), - Self::FLEX_LOGS_STARTER => String::from("flex_logs_starter"), - Self::FLEX_STORED_LOGS => String::from("flex_stored_logs"), - Self::FUNCTIONS_USAGE => String::from("functions_usage"), - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE => { - String::from("incident_management_monthly_active_users_usage") - } - Self::INDEXED_SPANS_USAGE => String::from("indexed_spans_usage"), - Self::INFRA_HOST_USAGE => String::from("infra_host_usage"), - Self::INGESTED_LOGS_BYTES_USAGE => String::from("ingested_logs_bytes_usage"), - Self::INGESTED_SPANS_BYTES_USAGE => String::from("ingested_spans_bytes_usage"), - Self::INVOCATIONS_USAGE => String::from("invocations_usage"), - Self::LAMBDA_TRACED_INVOCATIONS_USAGE => { - String::from("lambda_traced_invocations_usage") - } - Self::LLM_OBSERVABILITY_USAGE => String::from("llm_observability_usage"), - Self::LLM_SPANS_USAGE => String::from("llm_spans_usage"), - Self::LOGS_INDEXED_15DAY_USAGE => String::from("logs_indexed_15day_usage"), - Self::LOGS_INDEXED_180DAY_USAGE => String::from("logs_indexed_180day_usage"), - Self::LOGS_INDEXED_1DAY_USAGE => String::from("logs_indexed_1day_usage"), - Self::LOGS_INDEXED_30DAY_USAGE => String::from("logs_indexed_30day_usage"), - Self::LOGS_INDEXED_360DAY_USAGE => String::from("logs_indexed_360day_usage"), - Self::LOGS_INDEXED_3DAY_USAGE => String::from("logs_indexed_3day_usage"), - Self::LOGS_INDEXED_45DAY_USAGE => String::from("logs_indexed_45day_usage"), - Self::LOGS_INDEXED_60DAY_USAGE => String::from("logs_indexed_60day_usage"), - Self::LOGS_INDEXED_7DAY_USAGE => String::from("logs_indexed_7day_usage"), - Self::LOGS_INDEXED_90DAY_USAGE => String::from("logs_indexed_90day_usage"), - Self::LOGS_INDEXED_CUSTOM_RETENTION_USAGE => { - String::from("logs_indexed_custom_retention_usage") - } - Self::MOBILE_APP_TESTING_USAGE => String::from("mobile_app_testing_usage"), - Self::NDM_NETFLOW_USAGE => String::from("ndm_netflow_usage"), - Self::NETWORK_DEVICE_WIRELESS_USAGE => String::from("npm_host_usage"), - Self::NPM_HOST_USAGE => String::from("network_device_wireless_usage"), - Self::OBS_PIPELINE_BYTES_USAGE => String::from("obs_pipeline_bytes_usage"), - Self::OBS_PIPELINE_VCPU_USAGE => String::from("obs_pipelines_vcpu_usage"), - Self::ONLINE_ARCHIVE_USAGE => String::from("online_archive_usage"), - Self::PRODUCT_ANALYTICS_SESSION_USAGE => { - String::from("product_analytics_session_usage") - } - Self::PROFILED_CONTAINER_USAGE => String::from("profiled_container_usage"), - Self::PROFILED_FARGATE_USAGE => String::from("profiled_fargate_usage"), - Self::PROFILED_HOST_USAGE => String::from("profiled_host_usage"), - Self::PUBLISHED_APP_USAGE => String::from("published_app"), - Self::RUM_BROWSER_MOBILE_SESSIONS_USAGE => { - String::from("rum_browser_mobile_sessions_usage") - } - Self::RUM_INGESTED_USAGE => String::from("rum_ingested_usage"), - Self::RUM_INVESTIGATE_USAGE => String::from("rum_investigate_usage"), - Self::RUM_REPLAY_SESSIONS_USAGE => String::from("rum_replay_sessions_usage"), - Self::RUM_SESSION_REPLAY_ADD_ON_USAGE => { - String::from("rum_session_replay_add_on_usage") - } - Self::SCA_FARGATE_USAGE => String::from("sca_fargate_usage"), - Self::SDS_SCANNED_BYTES_USAGE => String::from("sds_scanned_bytes_usage"), - Self::SERVERLESS_APPS_USAGE => String::from("serverless_apps_usage"), - Self::SIEM_ANALYZED_LOGS_ADD_ON_USAGE => { - String::from("siem_analyzed_logs_add_on_usage") - } - Self::SIEM_INGESTED_BYTES_USAGE => String::from("siem_ingested_bytes_usage"), - Self::SNMP_USAGE => String::from("snmp_usage"), - Self::UNIVERSAL_SERVICE_MONITORING_USAGE => { - String::from("universal_service_monitoring_usage") - } - Self::VULN_MANAGEMENT_HOSTS_USAGE => String::from("vuln_management_hosts_usage"), - Self::WORKFLOW_EXECUTIONS_USAGE => String::from("workflow_executions_usage"), - Self::UnparsedObject(v) => v.value.to_string(), - } - } -} - -impl Serialize for HourlyUsageAttributionUsageType { - 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 HourlyUsageAttributionUsageType { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s: String = String::deserialize(deserializer)?; - Ok(match s.as_str() { - "api_usage" => Self::API_USAGE, - "apm_fargate_usage" => Self::APM_FARGATE_USAGE, - "apm_host_usage" => Self::APM_HOST_USAGE, - "apm_usm_usage" => Self::APM_USM_USAGE, - "appsec_fargate_usage" => Self::APPSEC_FARGATE_USAGE, - "appsec_usage" => Self::APPSEC_USAGE, - "asm_serverless_traced_invocations_usage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - } - "asm_serverless_traced_invocations_percentage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - } - "bits_ai_investigations_usage" => Self::BITS_AI_INVESTIGATIONS_USAGE, - "browser_usage" => Self::BROWSER_USAGE, - "ci_pipeline_indexed_spans_usage" => Self::CI_PIPELINE_INDEXED_SPANS_USAGE, - "ci_test_indexed_spans_usage" => Self::CI_TEST_INDEXED_SPANS_USAGE, - "ci_visibility_itr_usage" => Self::CI_VISIBILITY_ITR_USAGE, - "cloud_siem_usage" => Self::CLOUD_SIEM_USAGE, - "code_security_host_usage" => Self::CODE_SECURITY_HOST_USAGE, - "container_excl_agent_usage" => Self::CONTAINER_EXCL_AGENT_USAGE, - "container_usage" => Self::CONTAINER_USAGE, - "cspm_containers_usage" => Self::CSPM_CONTAINERS_USAGE, - "cspm_hosts_usage" => Self::CSPM_HOSTS_USAGE, - "custom_event_usage" => Self::CUSTOM_EVENT_USAGE, - "custom_ingested_timeseries_usage" => Self::CUSTOM_INGESTED_TIMESERIES_USAGE, - "custom_timeseries_usage" => Self::CUSTOM_TIMESERIES_USAGE, - "cws_containers_usage" => Self::CWS_CONTAINERS_USAGE, - "cws_fargate_task_usage" => Self::CWS_FARGATE_TASK_USAGE, - "cws_hosts_usage" => Self::CWS_HOSTS_USAGE, - "data_jobs_monitoring_usage" => Self::DATA_JOBS_MONITORING_USAGE, - "data_stream_monitoring_usage" => Self::DATA_STREAM_MONITORING_USAGE, - "dbm_hosts_usage" => Self::DBM_HOSTS_USAGE, - "dbm_queries_usage" => Self::DBM_QUERIES_USAGE, - "error_tracking_usage" => Self::ERROR_TRACKING_USAGE, - "error_tracking_percentage" => Self::ERROR_TRACKING_PERCENTAGE, - "estimated_indexed_spans_usage" => Self::ESTIMATED_INDEXED_SPANS_USAGE, - "estimated_ingested_spans_usage" => Self::ESTIMATED_INGESTED_SPANS_USAGE, - "fargate_usage" => Self::FARGATE_USAGE, - "flex_logs_starter" => Self::FLEX_LOGS_STARTER, - "flex_stored_logs" => Self::FLEX_STORED_LOGS, - "functions_usage" => Self::FUNCTIONS_USAGE, - "incident_management_monthly_active_users_usage" => { - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE - } - "indexed_spans_usage" => Self::INDEXED_SPANS_USAGE, - "infra_host_usage" => Self::INFRA_HOST_USAGE, - "ingested_logs_bytes_usage" => Self::INGESTED_LOGS_BYTES_USAGE, - "ingested_spans_bytes_usage" => Self::INGESTED_SPANS_BYTES_USAGE, - "invocations_usage" => Self::INVOCATIONS_USAGE, - "lambda_traced_invocations_usage" => Self::LAMBDA_TRACED_INVOCATIONS_USAGE, - "llm_observability_usage" => Self::LLM_OBSERVABILITY_USAGE, - "llm_spans_usage" => Self::LLM_SPANS_USAGE, - "logs_indexed_15day_usage" => Self::LOGS_INDEXED_15DAY_USAGE, - "logs_indexed_180day_usage" => Self::LOGS_INDEXED_180DAY_USAGE, - "logs_indexed_1day_usage" => Self::LOGS_INDEXED_1DAY_USAGE, - "logs_indexed_30day_usage" => Self::LOGS_INDEXED_30DAY_USAGE, - "logs_indexed_360day_usage" => Self::LOGS_INDEXED_360DAY_USAGE, - "logs_indexed_3day_usage" => Self::LOGS_INDEXED_3DAY_USAGE, - "logs_indexed_45day_usage" => Self::LOGS_INDEXED_45DAY_USAGE, - "logs_indexed_60day_usage" => Self::LOGS_INDEXED_60DAY_USAGE, - "logs_indexed_7day_usage" => Self::LOGS_INDEXED_7DAY_USAGE, - "logs_indexed_90day_usage" => Self::LOGS_INDEXED_90DAY_USAGE, - "logs_indexed_custom_retention_usage" => Self::LOGS_INDEXED_CUSTOM_RETENTION_USAGE, - "mobile_app_testing_usage" => Self::MOBILE_APP_TESTING_USAGE, - "ndm_netflow_usage" => Self::NDM_NETFLOW_USAGE, - "npm_host_usage" => Self::NETWORK_DEVICE_WIRELESS_USAGE, - "network_device_wireless_usage" => Self::NPM_HOST_USAGE, - "obs_pipeline_bytes_usage" => Self::OBS_PIPELINE_BYTES_USAGE, - "obs_pipelines_vcpu_usage" => Self::OBS_PIPELINE_VCPU_USAGE, - "online_archive_usage" => Self::ONLINE_ARCHIVE_USAGE, - "product_analytics_session_usage" => Self::PRODUCT_ANALYTICS_SESSION_USAGE, - "profiled_container_usage" => Self::PROFILED_CONTAINER_USAGE, - "profiled_fargate_usage" => Self::PROFILED_FARGATE_USAGE, - "profiled_host_usage" => Self::PROFILED_HOST_USAGE, - "published_app" => Self::PUBLISHED_APP_USAGE, - "rum_browser_mobile_sessions_usage" => Self::RUM_BROWSER_MOBILE_SESSIONS_USAGE, - "rum_ingested_usage" => Self::RUM_INGESTED_USAGE, - "rum_investigate_usage" => Self::RUM_INVESTIGATE_USAGE, - "rum_replay_sessions_usage" => Self::RUM_REPLAY_SESSIONS_USAGE, - "rum_session_replay_add_on_usage" => Self::RUM_SESSION_REPLAY_ADD_ON_USAGE, - "sca_fargate_usage" => Self::SCA_FARGATE_USAGE, - "sds_scanned_bytes_usage" => Self::SDS_SCANNED_BYTES_USAGE, - "serverless_apps_usage" => Self::SERVERLESS_APPS_USAGE, - "siem_analyzed_logs_add_on_usage" => Self::SIEM_ANALYZED_LOGS_ADD_ON_USAGE, - "siem_ingested_bytes_usage" => Self::SIEM_INGESTED_BYTES_USAGE, - "snmp_usage" => Self::SNMP_USAGE, - "universal_service_monitoring_usage" => Self::UNIVERSAL_SERVICE_MONITORING_USAGE, - "vuln_management_hosts_usage" => Self::VULN_MANAGEMENT_HOSTS_USAGE, - "workflow_executions_usage" => Self::WORKFLOW_EXECUTIONS_USAGE, - _ => Self::UnparsedObject(crate::datadog::UnparsedObject { - value: serde_json::Value::String(s.into()), - }), - }) - } -} diff --git a/src/datadogV1/model/model_monthly_usage_attribution_body.rs b/src/datadogV1/model/model_monthly_usage_attribution_body.rs index 922ce3e9e..af1e8ae9f 100644 --- a/src/datadogV1/model/model_monthly_usage_attribution_body.rs +++ b/src/datadogV1/model/model_monthly_usage_attribution_body.rs @@ -37,7 +37,6 @@ pub struct MonthlyUsageAttributionBody { #[serde(rename = "updated_at")] pub updated_at: Option>, /// Fields in Usage Summary by tag(s). - /// The following values have been **deprecated**: `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`. #[serde(rename = "values")] pub values: Option, #[serde(flatten)] diff --git a/src/datadogV1/model/model_monthly_usage_attribution_supported_metrics.rs b/src/datadogV1/model/model_monthly_usage_attribution_supported_metrics.rs deleted file mode 100644 index eeee0210d..000000000 --- a/src/datadogV1/model/model_monthly_usage_attribution_supported_metrics.rs +++ /dev/null @@ -1,612 +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, Serializer}; - -#[non_exhaustive] -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum MonthlyUsageAttributionSupportedMetrics { - API_USAGE, - API_PERCENTAGE, - APM_FARGATE_USAGE, - APM_FARGATE_PERCENTAGE, - APPSEC_FARGATE_USAGE, - APPSEC_FARGATE_PERCENTAGE, - APM_HOST_USAGE, - APM_HOST_PERCENTAGE, - APM_USM_USAGE, - APM_USM_PERCENTAGE, - APPSEC_USAGE, - APPSEC_PERCENTAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE, - BITS_AI_INVESTIGATIONS_USAGE, - BITS_AI_INVESTIGATIONS_PERCENTAGE, - BROWSER_USAGE, - BROWSER_PERCENTAGE, - CI_VISIBILITY_ITR_USAGE, - CI_VISIBILITY_ITR_PERCENTAGE, - CLOUD_SIEM_USAGE, - CLOUD_SIEM_PERCENTAGE, - CODE_SECURITY_HOST_USAGE, - CODE_SECURITY_HOST_PERCENTAGE, - CONTAINER_EXCL_AGENT_USAGE, - CONTAINER_EXCL_AGENT_PERCENTAGE, - CONTAINER_USAGE, - CONTAINER_PERCENTAGE, - CSPM_CONTAINERS_PERCENTAGE, - CSPM_CONTAINERS_USAGE, - CSPM_HOSTS_PERCENTAGE, - CSPM_HOSTS_USAGE, - CUSTOM_TIMESERIES_USAGE, - CUSTOM_TIMESERIES_PERCENTAGE, - CUSTOM_INGESTED_TIMESERIES_USAGE, - CUSTOM_INGESTED_TIMESERIES_PERCENTAGE, - CWS_CONTAINERS_PERCENTAGE, - CWS_CONTAINERS_USAGE, - CWS_FARGATE_TASK_PERCENTAGE, - CWS_FARGATE_TASK_USAGE, - CWS_HOSTS_PERCENTAGE, - CWS_HOSTS_USAGE, - DATA_JOBS_MONITORING_USAGE, - DATA_JOBS_MONITORING_PERCENTAGE, - DATA_STREAM_MONITORING_USAGE, - DATA_STREAM_MONITORING_PERCENTAGE, - DBM_HOSTS_PERCENTAGE, - DBM_HOSTS_USAGE, - DBM_QUERIES_PERCENTAGE, - DBM_QUERIES_USAGE, - ERROR_TRACKING_USAGE, - ERROR_TRACKING_PERCENTAGE, - ESTIMATED_INDEXED_SPANS_USAGE, - ESTIMATED_INDEXED_SPANS_PERCENTAGE, - ESTIMATED_INGESTED_SPANS_USAGE, - ESTIMATED_INGESTED_SPANS_PERCENTAGE, - FARGATE_USAGE, - FARGATE_PERCENTAGE, - FLEX_LOGS_STARTER_USAGE, - FLEX_LOGS_STARTER_PERCENTAGE, - FLEX_STORED_LOGS_USAGE, - FLEX_STORED_LOGS_PERCENTAGE, - FUNCTIONS_USAGE, - FUNCTIONS_PERCENTAGE, - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE, - INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_PERCENTAGE, - INFRA_HOST_USAGE, - INFRA_HOST_PERCENTAGE, - INVOCATIONS_USAGE, - INVOCATIONS_PERCENTAGE, - LAMBDA_TRACED_INVOCATIONS_USAGE, - LAMBDA_TRACED_INVOCATIONS_PERCENTAGE, - LLM_OBSERVABILITY_USAGE, - LLM_OBSERVABILITY_PERCENTAGE, - LLM_SPANS_USAGE, - LLM_SPANS_PERCENTAGE, - MOBILE_APP_TESTING_USAGE, - MOBILE_APP_TESTING_PERCENTAGE, - NDM_NETFLOW_USAGE, - NDM_NETFLOW_PERCENTAGE, - NETWORK_DEVICE_WIRELESS_USAGE, - NETWORK_DEVICE_WIRELESS_PERCENTAGE, - NPM_HOST_USAGE, - NPM_HOST_PERCENTAGE, - OBS_PIPELINE_BYTES_USAGE, - OBS_PIPELINE_BYTES_PERCENTAGE, - OBS_PIPELINES_VCPU_USAGE, - OBS_PIPELINES_VCPU_PERCENTAGE, - ONLINE_ARCHIVE_USAGE, - ONLINE_ARCHIVE_PERCENTAGE, - PRODUCT_ANALYTICS_SESSION_USAGE, - PRODUCT_ANALYTICS_SESSION_PERCENTAGE, - PROFILED_CONTAINER_USAGE, - PROFILED_CONTAINER_PERCENTAGE, - PROFILED_FARGATE_USAGE, - PROFILED_FARGATE_PERCENTAGE, - PROFILED_HOST_USAGE, - PROFILED_HOST_PERCENTAGE, - PUBLISHED_APP_USAGE, - PUBLISHED_APP_PERCENTAGE, - SERVERLESS_APPS_USAGE, - SERVERLESS_APPS_PERCENTAGE, - SNMP_USAGE, - SNMP_PERCENTAGE, - UNIVERSAL_SERVICE_MONITORING_USAGE, - UNIVERSAL_SERVICE_MONITORING_PERCENTAGE, - VULN_MANAGEMENT_HOSTS_USAGE, - VULN_MANAGEMENT_HOSTS_PERCENTAGE, - SDS_SCANNED_BYTES_USAGE, - SDS_SCANNED_BYTES_PERCENTAGE, - CI_TEST_INDEXED_SPANS_USAGE, - CI_TEST_INDEXED_SPANS_PERCENTAGE, - INGESTED_LOGS_BYTES_USAGE, - INGESTED_LOGS_BYTES_PERCENTAGE, - CI_PIPELINE_INDEXED_SPANS_USAGE, - CI_PIPELINE_INDEXED_SPANS_PERCENTAGE, - INDEXED_SPANS_USAGE, - INDEXED_SPANS_PERCENTAGE, - CUSTOM_EVENT_USAGE, - CUSTOM_EVENT_PERCENTAGE, - LOGS_INDEXED_CUSTOM_RETENTION_USAGE, - LOGS_INDEXED_CUSTOM_RETENTION_PERCENTAGE, - LOGS_INDEXED_360DAY_USAGE, - LOGS_INDEXED_360DAY_PERCENTAGE, - LOGS_INDEXED_180DAY_USAGE, - LOGS_INDEXED_180DAY_PERCENTAGE, - LOGS_INDEXED_90DAY_USAGE, - LOGS_INDEXED_90DAY_PERCENTAGE, - LOGS_INDEXED_60DAY_USAGE, - LOGS_INDEXED_60DAY_PERCENTAGE, - LOGS_INDEXED_45DAY_USAGE, - LOGS_INDEXED_45DAY_PERCENTAGE, - LOGS_INDEXED_30DAY_USAGE, - LOGS_INDEXED_30DAY_PERCENTAGE, - LOGS_INDEXED_15DAY_USAGE, - LOGS_INDEXED_15DAY_PERCENTAGE, - LOGS_INDEXED_7DAY_USAGE, - LOGS_INDEXED_7DAY_PERCENTAGE, - LOGS_INDEXED_3DAY_USAGE, - LOGS_INDEXED_3DAY_PERCENTAGE, - LOGS_INDEXED_1DAY_USAGE, - LOGS_INDEXED_1DAY_PERCENTAGE, - RUM_INGESTED_USAGE, - RUM_INGESTED_PERCENTAGE, - RUM_INVESTIGATE_USAGE, - RUM_INVESTIGATE_PERCENTAGE, - RUM_REPLAY_SESSIONS_USAGE, - RUM_REPLAY_SESSIONS_PERCENTAGE, - RUM_SESSION_REPLAY_ADD_ON_USAGE, - RUM_SESSION_REPLAY_ADD_ON_PERCENTAGE, - RUM_BROWSER_MOBILE_SESSIONS_USAGE, - RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE, - INGESTED_SPANS_BYTES_USAGE, - INGESTED_SPANS_BYTES_PERCENTAGE, - SIEM_ANALYZED_LOGS_ADD_ON_USAGE, - SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE, - SIEM_INGESTED_BYTES_USAGE, - SIEM_INGESTED_BYTES_PERCENTAGE, - WORKFLOW_EXECUTIONS_USAGE, - WORKFLOW_EXECUTIONS_PERCENTAGE, - SCA_FARGATE_USAGE, - SCA_FARGATE_PERCENTAGE, - ALL, - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl ToString for MonthlyUsageAttributionSupportedMetrics { - fn to_string(&self) -> String { - match self { - Self::API_USAGE => String::from("api_usage"), - Self::API_PERCENTAGE => String::from("api_percentage"), - Self::APM_FARGATE_USAGE => String::from("apm_fargate_usage"), - Self::APM_FARGATE_PERCENTAGE => String::from("apm_fargate_percentage"), - Self::APPSEC_FARGATE_USAGE => String::from("appsec_fargate_usage"), - Self::APPSEC_FARGATE_PERCENTAGE => String::from("appsec_fargate_percentage"), - Self::APM_HOST_USAGE => String::from("apm_host_usage"), - Self::APM_HOST_PERCENTAGE => String::from("apm_host_percentage"), - Self::APM_USM_USAGE => String::from("apm_usm_usage"), - Self::APM_USM_PERCENTAGE => String::from("apm_usm_percentage"), - Self::APPSEC_USAGE => String::from("appsec_usage"), - Self::APPSEC_PERCENTAGE => String::from("appsec_percentage"), - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE => { - String::from("asm_serverless_traced_invocations_usage") - } - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE => { - String::from("asm_serverless_traced_invocations_percentage") - } - Self::BITS_AI_INVESTIGATIONS_USAGE => String::from("bits_ai_investigations_usage"), - Self::BITS_AI_INVESTIGATIONS_PERCENTAGE => { - String::from("bits_ai_investigations_percentage") - } - Self::BROWSER_USAGE => String::from("browser_usage"), - Self::BROWSER_PERCENTAGE => String::from("browser_percentage"), - Self::CI_VISIBILITY_ITR_USAGE => String::from("ci_visibility_itr_usage"), - Self::CI_VISIBILITY_ITR_PERCENTAGE => String::from("ci_visibility_itr_percentage"), - Self::CLOUD_SIEM_USAGE => String::from("cloud_siem_usage"), - Self::CLOUD_SIEM_PERCENTAGE => String::from("cloud_siem_percentage"), - Self::CODE_SECURITY_HOST_USAGE => String::from("code_security_host_usage"), - Self::CODE_SECURITY_HOST_PERCENTAGE => String::from("code_security_host_percentage"), - Self::CONTAINER_EXCL_AGENT_USAGE => String::from("container_excl_agent_usage"), - Self::CONTAINER_EXCL_AGENT_PERCENTAGE => { - String::from("container_excl_agent_percentage") - } - Self::CONTAINER_USAGE => String::from("container_usage"), - Self::CONTAINER_PERCENTAGE => String::from("container_percentage"), - Self::CSPM_CONTAINERS_PERCENTAGE => String::from("cspm_containers_percentage"), - Self::CSPM_CONTAINERS_USAGE => String::from("cspm_containers_usage"), - Self::CSPM_HOSTS_PERCENTAGE => String::from("cspm_hosts_percentage"), - Self::CSPM_HOSTS_USAGE => String::from("cspm_hosts_usage"), - Self::CUSTOM_TIMESERIES_USAGE => String::from("custom_timeseries_usage"), - Self::CUSTOM_TIMESERIES_PERCENTAGE => String::from("custom_timeseries_percentage"), - Self::CUSTOM_INGESTED_TIMESERIES_USAGE => { - String::from("custom_ingested_timeseries_usage") - } - Self::CUSTOM_INGESTED_TIMESERIES_PERCENTAGE => { - String::from("custom_ingested_timeseries_percentage") - } - Self::CWS_CONTAINERS_PERCENTAGE => String::from("cws_containers_percentage"), - Self::CWS_CONTAINERS_USAGE => String::from("cws_containers_usage"), - Self::CWS_FARGATE_TASK_PERCENTAGE => String::from("cws_fargate_task_percentage"), - Self::CWS_FARGATE_TASK_USAGE => String::from("cws_fargate_task_usage"), - Self::CWS_HOSTS_PERCENTAGE => String::from("cws_hosts_percentage"), - Self::CWS_HOSTS_USAGE => String::from("cws_hosts_usage"), - Self::DATA_JOBS_MONITORING_USAGE => String::from("data_jobs_monitoring_usage"), - Self::DATA_JOBS_MONITORING_PERCENTAGE => { - String::from("data_jobs_monitoring_percentage") - } - Self::DATA_STREAM_MONITORING_USAGE => String::from("data_stream_monitoring_usage"), - Self::DATA_STREAM_MONITORING_PERCENTAGE => { - String::from("data_stream_monitoring_percentage") - } - Self::DBM_HOSTS_PERCENTAGE => String::from("dbm_hosts_percentage"), - Self::DBM_HOSTS_USAGE => String::from("dbm_hosts_usage"), - Self::DBM_QUERIES_PERCENTAGE => String::from("dbm_queries_percentage"), - Self::DBM_QUERIES_USAGE => String::from("dbm_queries_usage"), - Self::ERROR_TRACKING_USAGE => String::from("error_tracking_usage"), - Self::ERROR_TRACKING_PERCENTAGE => String::from("error_tracking_percentage"), - Self::ESTIMATED_INDEXED_SPANS_USAGE => String::from("estimated_indexed_spans_usage"), - Self::ESTIMATED_INDEXED_SPANS_PERCENTAGE => { - String::from("estimated_indexed_spans_percentage") - } - Self::ESTIMATED_INGESTED_SPANS_USAGE => String::from("estimated_ingested_spans_usage"), - Self::ESTIMATED_INGESTED_SPANS_PERCENTAGE => { - String::from("estimated_ingested_spans_percentage") - } - Self::FARGATE_USAGE => String::from("fargate_usage"), - Self::FARGATE_PERCENTAGE => String::from("fargate_percentage"), - Self::FLEX_LOGS_STARTER_USAGE => String::from("flex_logs_starter_usage"), - Self::FLEX_LOGS_STARTER_PERCENTAGE => String::from("flex_logs_starter_percentage"), - Self::FLEX_STORED_LOGS_USAGE => String::from("flex_stored_logs_usage"), - Self::FLEX_STORED_LOGS_PERCENTAGE => String::from("flex_stored_logs_percentage"), - Self::FUNCTIONS_USAGE => String::from("functions_usage"), - Self::FUNCTIONS_PERCENTAGE => String::from("functions_percentage"), - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE => { - String::from("incident_management_monthly_active_users_usage") - } - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_PERCENTAGE => { - String::from("incident_management_monthly_active_users_percentage") - } - Self::INFRA_HOST_USAGE => String::from("infra_host_usage"), - Self::INFRA_HOST_PERCENTAGE => String::from("infra_host_percentage"), - Self::INVOCATIONS_USAGE => String::from("invocations_usage"), - Self::INVOCATIONS_PERCENTAGE => String::from("invocations_percentage"), - Self::LAMBDA_TRACED_INVOCATIONS_USAGE => { - String::from("lambda_traced_invocations_usage") - } - Self::LAMBDA_TRACED_INVOCATIONS_PERCENTAGE => { - String::from("lambda_traced_invocations_percentage") - } - Self::LLM_OBSERVABILITY_USAGE => String::from("llm_observability_usage"), - Self::LLM_OBSERVABILITY_PERCENTAGE => String::from("llm_observability_percentage"), - Self::LLM_SPANS_USAGE => String::from("llm_spans_usage"), - Self::LLM_SPANS_PERCENTAGE => String::from("llm_spans_percentage"), - Self::MOBILE_APP_TESTING_USAGE => String::from("mobile_app_testing_percentage"), - Self::MOBILE_APP_TESTING_PERCENTAGE => String::from("mobile_app_testing_usage"), - Self::NDM_NETFLOW_USAGE => String::from("ndm_netflow_usage"), - Self::NDM_NETFLOW_PERCENTAGE => String::from("ndm_netflow_percentage"), - Self::NETWORK_DEVICE_WIRELESS_USAGE => String::from("network_device_wireless_usage"), - Self::NETWORK_DEVICE_WIRELESS_PERCENTAGE => { - String::from("network_device_wireless_percentage") - } - Self::NPM_HOST_USAGE => String::from("npm_host_usage"), - Self::NPM_HOST_PERCENTAGE => String::from("npm_host_percentage"), - Self::OBS_PIPELINE_BYTES_USAGE => String::from("obs_pipeline_bytes_usage"), - Self::OBS_PIPELINE_BYTES_PERCENTAGE => String::from("obs_pipeline_bytes_percentage"), - Self::OBS_PIPELINES_VCPU_USAGE => String::from("obs_pipelines_vcpu_usage"), - Self::OBS_PIPELINES_VCPU_PERCENTAGE => String::from("obs_pipelines_vcpu_percentage"), - Self::ONLINE_ARCHIVE_USAGE => String::from("online_archive_usage"), - Self::ONLINE_ARCHIVE_PERCENTAGE => String::from("online_archive_percentage"), - Self::PRODUCT_ANALYTICS_SESSION_USAGE => { - String::from("product_analytics_session_usage") - } - Self::PRODUCT_ANALYTICS_SESSION_PERCENTAGE => { - String::from("product_analytics_session_percentage") - } - Self::PROFILED_CONTAINER_USAGE => String::from("profiled_container_usage"), - Self::PROFILED_CONTAINER_PERCENTAGE => String::from("profiled_container_percentage"), - Self::PROFILED_FARGATE_USAGE => String::from("profiled_fargate_usage"), - Self::PROFILED_FARGATE_PERCENTAGE => String::from("profiled_fargate_percentage"), - Self::PROFILED_HOST_USAGE => String::from("profiled_host_usage"), - Self::PROFILED_HOST_PERCENTAGE => String::from("profiled_host_percentage"), - Self::PUBLISHED_APP_USAGE => String::from("published_app_usage"), - Self::PUBLISHED_APP_PERCENTAGE => String::from("published_app_percentage"), - Self::SERVERLESS_APPS_USAGE => String::from("serverless_apps_usage"), - Self::SERVERLESS_APPS_PERCENTAGE => String::from("serverless_apps_percentage"), - Self::SNMP_USAGE => String::from("snmp_usage"), - Self::SNMP_PERCENTAGE => String::from("snmp_percentage"), - Self::UNIVERSAL_SERVICE_MONITORING_USAGE => { - String::from("universal_service_monitoring_usage") - } - Self::UNIVERSAL_SERVICE_MONITORING_PERCENTAGE => { - String::from("universal_service_monitoring_percentage") - } - Self::VULN_MANAGEMENT_HOSTS_USAGE => String::from("vuln_management_hosts_usage"), - Self::VULN_MANAGEMENT_HOSTS_PERCENTAGE => { - String::from("vuln_management_hosts_percentage") - } - Self::SDS_SCANNED_BYTES_USAGE => String::from("sds_scanned_bytes_usage"), - Self::SDS_SCANNED_BYTES_PERCENTAGE => String::from("sds_scanned_bytes_percentage"), - Self::CI_TEST_INDEXED_SPANS_USAGE => String::from("ci_test_indexed_spans_usage"), - Self::CI_TEST_INDEXED_SPANS_PERCENTAGE => { - String::from("ci_test_indexed_spans_percentage") - } - Self::INGESTED_LOGS_BYTES_USAGE => String::from("ingested_logs_bytes_usage"), - Self::INGESTED_LOGS_BYTES_PERCENTAGE => String::from("ingested_logs_bytes_percentage"), - Self::CI_PIPELINE_INDEXED_SPANS_USAGE => { - String::from("ci_pipeline_indexed_spans_usage") - } - Self::CI_PIPELINE_INDEXED_SPANS_PERCENTAGE => { - String::from("ci_pipeline_indexed_spans_percentage") - } - Self::INDEXED_SPANS_USAGE => String::from("indexed_spans_usage"), - Self::INDEXED_SPANS_PERCENTAGE => String::from("indexed_spans_percentage"), - Self::CUSTOM_EVENT_USAGE => String::from("custom_event_usage"), - Self::CUSTOM_EVENT_PERCENTAGE => String::from("custom_event_percentage"), - Self::LOGS_INDEXED_CUSTOM_RETENTION_USAGE => { - String::from("logs_indexed_custom_retention_usage") - } - Self::LOGS_INDEXED_CUSTOM_RETENTION_PERCENTAGE => { - String::from("logs_indexed_custom_retention_percentage") - } - Self::LOGS_INDEXED_360DAY_USAGE => String::from("logs_indexed_360day_usage"), - Self::LOGS_INDEXED_360DAY_PERCENTAGE => String::from("logs_indexed_360day_percentage"), - Self::LOGS_INDEXED_180DAY_USAGE => String::from("logs_indexed_180day_usage"), - Self::LOGS_INDEXED_180DAY_PERCENTAGE => String::from("logs_indexed_180day_percentage"), - Self::LOGS_INDEXED_90DAY_USAGE => String::from("logs_indexed_90day_usage"), - Self::LOGS_INDEXED_90DAY_PERCENTAGE => String::from("logs_indexed_90day_percentage"), - Self::LOGS_INDEXED_60DAY_USAGE => String::from("logs_indexed_60day_usage"), - Self::LOGS_INDEXED_60DAY_PERCENTAGE => String::from("logs_indexed_60day_percentage"), - Self::LOGS_INDEXED_45DAY_USAGE => String::from("logs_indexed_45day_usage"), - Self::LOGS_INDEXED_45DAY_PERCENTAGE => String::from("logs_indexed_45day_percentage"), - Self::LOGS_INDEXED_30DAY_USAGE => String::from("logs_indexed_30day_usage"), - Self::LOGS_INDEXED_30DAY_PERCENTAGE => String::from("logs_indexed_30day_percentage"), - Self::LOGS_INDEXED_15DAY_USAGE => String::from("logs_indexed_15day_usage"), - Self::LOGS_INDEXED_15DAY_PERCENTAGE => String::from("logs_indexed_15day_percentage"), - Self::LOGS_INDEXED_7DAY_USAGE => String::from("logs_indexed_7day_usage"), - Self::LOGS_INDEXED_7DAY_PERCENTAGE => String::from("logs_indexed_7day_percentage"), - Self::LOGS_INDEXED_3DAY_USAGE => String::from("logs_indexed_3day_usage"), - Self::LOGS_INDEXED_3DAY_PERCENTAGE => String::from("logs_indexed_3day_percentage"), - Self::LOGS_INDEXED_1DAY_USAGE => String::from("logs_indexed_1day_usage"), - Self::LOGS_INDEXED_1DAY_PERCENTAGE => String::from("logs_indexed_1day_percentage"), - Self::RUM_INGESTED_USAGE => String::from("rum_ingested_usage"), - Self::RUM_INGESTED_PERCENTAGE => String::from("rum_ingested_percentage"), - Self::RUM_INVESTIGATE_USAGE => String::from("rum_investigate_usage"), - Self::RUM_INVESTIGATE_PERCENTAGE => String::from("rum_investigate_percentage"), - Self::RUM_REPLAY_SESSIONS_USAGE => String::from("rum_replay_sessions_usage"), - Self::RUM_REPLAY_SESSIONS_PERCENTAGE => String::from("rum_replay_sessions_percentage"), - Self::RUM_SESSION_REPLAY_ADD_ON_USAGE => { - String::from("rum_session_replay_add_on_usage") - } - Self::RUM_SESSION_REPLAY_ADD_ON_PERCENTAGE => { - String::from("rum_session_replay_add_on_percentage") - } - Self::RUM_BROWSER_MOBILE_SESSIONS_USAGE => { - String::from("rum_browser_mobile_sessions_usage") - } - Self::RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE => { - String::from("rum_browser_mobile_sessions_percentage") - } - Self::INGESTED_SPANS_BYTES_USAGE => String::from("ingested_spans_bytes_usage"), - Self::INGESTED_SPANS_BYTES_PERCENTAGE => { - String::from("ingested_spans_bytes_percentage") - } - Self::SIEM_ANALYZED_LOGS_ADD_ON_USAGE => { - String::from("siem_analyzed_logs_add_on_usage") - } - Self::SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE => { - String::from("siem_analyzed_logs_add_on_percentage") - } - Self::SIEM_INGESTED_BYTES_USAGE => String::from("siem_ingested_bytes_usage"), - Self::SIEM_INGESTED_BYTES_PERCENTAGE => String::from("siem_ingested_bytes_percentage"), - Self::WORKFLOW_EXECUTIONS_USAGE => String::from("workflow_executions_usage"), - Self::WORKFLOW_EXECUTIONS_PERCENTAGE => String::from("workflow_executions_percentage"), - Self::SCA_FARGATE_USAGE => String::from("sca_fargate_usage"), - Self::SCA_FARGATE_PERCENTAGE => String::from("sca_fargate_percentage"), - Self::ALL => String::from("*"), - Self::UnparsedObject(v) => v.value.to_string(), - } - } -} - -impl Serialize for MonthlyUsageAttributionSupportedMetrics { - 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 MonthlyUsageAttributionSupportedMetrics { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s: String = String::deserialize(deserializer)?; - Ok(match s.as_str() { - "api_usage" => Self::API_USAGE, - "api_percentage" => Self::API_PERCENTAGE, - "apm_fargate_usage" => Self::APM_FARGATE_USAGE, - "apm_fargate_percentage" => Self::APM_FARGATE_PERCENTAGE, - "appsec_fargate_usage" => Self::APPSEC_FARGATE_USAGE, - "appsec_fargate_percentage" => Self::APPSEC_FARGATE_PERCENTAGE, - "apm_host_usage" => Self::APM_HOST_USAGE, - "apm_host_percentage" => Self::APM_HOST_PERCENTAGE, - "apm_usm_usage" => Self::APM_USM_USAGE, - "apm_usm_percentage" => Self::APM_USM_PERCENTAGE, - "appsec_usage" => Self::APPSEC_USAGE, - "appsec_percentage" => Self::APPSEC_PERCENTAGE, - "asm_serverless_traced_invocations_usage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - } - "asm_serverless_traced_invocations_percentage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - } - "bits_ai_investigations_usage" => Self::BITS_AI_INVESTIGATIONS_USAGE, - "bits_ai_investigations_percentage" => Self::BITS_AI_INVESTIGATIONS_PERCENTAGE, - "browser_usage" => Self::BROWSER_USAGE, - "browser_percentage" => Self::BROWSER_PERCENTAGE, - "ci_visibility_itr_usage" => Self::CI_VISIBILITY_ITR_USAGE, - "ci_visibility_itr_percentage" => Self::CI_VISIBILITY_ITR_PERCENTAGE, - "cloud_siem_usage" => Self::CLOUD_SIEM_USAGE, - "cloud_siem_percentage" => Self::CLOUD_SIEM_PERCENTAGE, - "code_security_host_usage" => Self::CODE_SECURITY_HOST_USAGE, - "code_security_host_percentage" => Self::CODE_SECURITY_HOST_PERCENTAGE, - "container_excl_agent_usage" => Self::CONTAINER_EXCL_AGENT_USAGE, - "container_excl_agent_percentage" => Self::CONTAINER_EXCL_AGENT_PERCENTAGE, - "container_usage" => Self::CONTAINER_USAGE, - "container_percentage" => Self::CONTAINER_PERCENTAGE, - "cspm_containers_percentage" => Self::CSPM_CONTAINERS_PERCENTAGE, - "cspm_containers_usage" => Self::CSPM_CONTAINERS_USAGE, - "cspm_hosts_percentage" => Self::CSPM_HOSTS_PERCENTAGE, - "cspm_hosts_usage" => Self::CSPM_HOSTS_USAGE, - "custom_timeseries_usage" => Self::CUSTOM_TIMESERIES_USAGE, - "custom_timeseries_percentage" => Self::CUSTOM_TIMESERIES_PERCENTAGE, - "custom_ingested_timeseries_usage" => Self::CUSTOM_INGESTED_TIMESERIES_USAGE, - "custom_ingested_timeseries_percentage" => Self::CUSTOM_INGESTED_TIMESERIES_PERCENTAGE, - "cws_containers_percentage" => Self::CWS_CONTAINERS_PERCENTAGE, - "cws_containers_usage" => Self::CWS_CONTAINERS_USAGE, - "cws_fargate_task_percentage" => Self::CWS_FARGATE_TASK_PERCENTAGE, - "cws_fargate_task_usage" => Self::CWS_FARGATE_TASK_USAGE, - "cws_hosts_percentage" => Self::CWS_HOSTS_PERCENTAGE, - "cws_hosts_usage" => Self::CWS_HOSTS_USAGE, - "data_jobs_monitoring_usage" => Self::DATA_JOBS_MONITORING_USAGE, - "data_jobs_monitoring_percentage" => Self::DATA_JOBS_MONITORING_PERCENTAGE, - "data_stream_monitoring_usage" => Self::DATA_STREAM_MONITORING_USAGE, - "data_stream_monitoring_percentage" => Self::DATA_STREAM_MONITORING_PERCENTAGE, - "dbm_hosts_percentage" => Self::DBM_HOSTS_PERCENTAGE, - "dbm_hosts_usage" => Self::DBM_HOSTS_USAGE, - "dbm_queries_percentage" => Self::DBM_QUERIES_PERCENTAGE, - "dbm_queries_usage" => Self::DBM_QUERIES_USAGE, - "error_tracking_usage" => Self::ERROR_TRACKING_USAGE, - "error_tracking_percentage" => Self::ERROR_TRACKING_PERCENTAGE, - "estimated_indexed_spans_usage" => Self::ESTIMATED_INDEXED_SPANS_USAGE, - "estimated_indexed_spans_percentage" => Self::ESTIMATED_INDEXED_SPANS_PERCENTAGE, - "estimated_ingested_spans_usage" => Self::ESTIMATED_INGESTED_SPANS_USAGE, - "estimated_ingested_spans_percentage" => Self::ESTIMATED_INGESTED_SPANS_PERCENTAGE, - "fargate_usage" => Self::FARGATE_USAGE, - "fargate_percentage" => Self::FARGATE_PERCENTAGE, - "flex_logs_starter_usage" => Self::FLEX_LOGS_STARTER_USAGE, - "flex_logs_starter_percentage" => Self::FLEX_LOGS_STARTER_PERCENTAGE, - "flex_stored_logs_usage" => Self::FLEX_STORED_LOGS_USAGE, - "flex_stored_logs_percentage" => Self::FLEX_STORED_LOGS_PERCENTAGE, - "functions_usage" => Self::FUNCTIONS_USAGE, - "functions_percentage" => Self::FUNCTIONS_PERCENTAGE, - "incident_management_monthly_active_users_usage" => { - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_USAGE - } - "incident_management_monthly_active_users_percentage" => { - Self::INCIDENT_MANAGEMENT_MONTHLY_ACTIVE_USERS_PERCENTAGE - } - "infra_host_usage" => Self::INFRA_HOST_USAGE, - "infra_host_percentage" => Self::INFRA_HOST_PERCENTAGE, - "invocations_usage" => Self::INVOCATIONS_USAGE, - "invocations_percentage" => Self::INVOCATIONS_PERCENTAGE, - "lambda_traced_invocations_usage" => Self::LAMBDA_TRACED_INVOCATIONS_USAGE, - "lambda_traced_invocations_percentage" => Self::LAMBDA_TRACED_INVOCATIONS_PERCENTAGE, - "llm_observability_usage" => Self::LLM_OBSERVABILITY_USAGE, - "llm_observability_percentage" => Self::LLM_OBSERVABILITY_PERCENTAGE, - "llm_spans_usage" => Self::LLM_SPANS_USAGE, - "llm_spans_percentage" => Self::LLM_SPANS_PERCENTAGE, - "mobile_app_testing_percentage" => Self::MOBILE_APP_TESTING_USAGE, - "mobile_app_testing_usage" => Self::MOBILE_APP_TESTING_PERCENTAGE, - "ndm_netflow_usage" => Self::NDM_NETFLOW_USAGE, - "ndm_netflow_percentage" => Self::NDM_NETFLOW_PERCENTAGE, - "network_device_wireless_usage" => Self::NETWORK_DEVICE_WIRELESS_USAGE, - "network_device_wireless_percentage" => Self::NETWORK_DEVICE_WIRELESS_PERCENTAGE, - "npm_host_usage" => Self::NPM_HOST_USAGE, - "npm_host_percentage" => Self::NPM_HOST_PERCENTAGE, - "obs_pipeline_bytes_usage" => Self::OBS_PIPELINE_BYTES_USAGE, - "obs_pipeline_bytes_percentage" => Self::OBS_PIPELINE_BYTES_PERCENTAGE, - "obs_pipelines_vcpu_usage" => Self::OBS_PIPELINES_VCPU_USAGE, - "obs_pipelines_vcpu_percentage" => Self::OBS_PIPELINES_VCPU_PERCENTAGE, - "online_archive_usage" => Self::ONLINE_ARCHIVE_USAGE, - "online_archive_percentage" => Self::ONLINE_ARCHIVE_PERCENTAGE, - "product_analytics_session_usage" => Self::PRODUCT_ANALYTICS_SESSION_USAGE, - "product_analytics_session_percentage" => Self::PRODUCT_ANALYTICS_SESSION_PERCENTAGE, - "profiled_container_usage" => Self::PROFILED_CONTAINER_USAGE, - "profiled_container_percentage" => Self::PROFILED_CONTAINER_PERCENTAGE, - "profiled_fargate_usage" => Self::PROFILED_FARGATE_USAGE, - "profiled_fargate_percentage" => Self::PROFILED_FARGATE_PERCENTAGE, - "profiled_host_usage" => Self::PROFILED_HOST_USAGE, - "profiled_host_percentage" => Self::PROFILED_HOST_PERCENTAGE, - "published_app_usage" => Self::PUBLISHED_APP_USAGE, - "published_app_percentage" => Self::PUBLISHED_APP_PERCENTAGE, - "serverless_apps_usage" => Self::SERVERLESS_APPS_USAGE, - "serverless_apps_percentage" => Self::SERVERLESS_APPS_PERCENTAGE, - "snmp_usage" => Self::SNMP_USAGE, - "snmp_percentage" => Self::SNMP_PERCENTAGE, - "universal_service_monitoring_usage" => Self::UNIVERSAL_SERVICE_MONITORING_USAGE, - "universal_service_monitoring_percentage" => { - Self::UNIVERSAL_SERVICE_MONITORING_PERCENTAGE - } - "vuln_management_hosts_usage" => Self::VULN_MANAGEMENT_HOSTS_USAGE, - "vuln_management_hosts_percentage" => Self::VULN_MANAGEMENT_HOSTS_PERCENTAGE, - "sds_scanned_bytes_usage" => Self::SDS_SCANNED_BYTES_USAGE, - "sds_scanned_bytes_percentage" => Self::SDS_SCANNED_BYTES_PERCENTAGE, - "ci_test_indexed_spans_usage" => Self::CI_TEST_INDEXED_SPANS_USAGE, - "ci_test_indexed_spans_percentage" => Self::CI_TEST_INDEXED_SPANS_PERCENTAGE, - "ingested_logs_bytes_usage" => Self::INGESTED_LOGS_BYTES_USAGE, - "ingested_logs_bytes_percentage" => Self::INGESTED_LOGS_BYTES_PERCENTAGE, - "ci_pipeline_indexed_spans_usage" => Self::CI_PIPELINE_INDEXED_SPANS_USAGE, - "ci_pipeline_indexed_spans_percentage" => Self::CI_PIPELINE_INDEXED_SPANS_PERCENTAGE, - "indexed_spans_usage" => Self::INDEXED_SPANS_USAGE, - "indexed_spans_percentage" => Self::INDEXED_SPANS_PERCENTAGE, - "custom_event_usage" => Self::CUSTOM_EVENT_USAGE, - "custom_event_percentage" => Self::CUSTOM_EVENT_PERCENTAGE, - "logs_indexed_custom_retention_usage" => Self::LOGS_INDEXED_CUSTOM_RETENTION_USAGE, - "logs_indexed_custom_retention_percentage" => { - Self::LOGS_INDEXED_CUSTOM_RETENTION_PERCENTAGE - } - "logs_indexed_360day_usage" => Self::LOGS_INDEXED_360DAY_USAGE, - "logs_indexed_360day_percentage" => Self::LOGS_INDEXED_360DAY_PERCENTAGE, - "logs_indexed_180day_usage" => Self::LOGS_INDEXED_180DAY_USAGE, - "logs_indexed_180day_percentage" => Self::LOGS_INDEXED_180DAY_PERCENTAGE, - "logs_indexed_90day_usage" => Self::LOGS_INDEXED_90DAY_USAGE, - "logs_indexed_90day_percentage" => Self::LOGS_INDEXED_90DAY_PERCENTAGE, - "logs_indexed_60day_usage" => Self::LOGS_INDEXED_60DAY_USAGE, - "logs_indexed_60day_percentage" => Self::LOGS_INDEXED_60DAY_PERCENTAGE, - "logs_indexed_45day_usage" => Self::LOGS_INDEXED_45DAY_USAGE, - "logs_indexed_45day_percentage" => Self::LOGS_INDEXED_45DAY_PERCENTAGE, - "logs_indexed_30day_usage" => Self::LOGS_INDEXED_30DAY_USAGE, - "logs_indexed_30day_percentage" => Self::LOGS_INDEXED_30DAY_PERCENTAGE, - "logs_indexed_15day_usage" => Self::LOGS_INDEXED_15DAY_USAGE, - "logs_indexed_15day_percentage" => Self::LOGS_INDEXED_15DAY_PERCENTAGE, - "logs_indexed_7day_usage" => Self::LOGS_INDEXED_7DAY_USAGE, - "logs_indexed_7day_percentage" => Self::LOGS_INDEXED_7DAY_PERCENTAGE, - "logs_indexed_3day_usage" => Self::LOGS_INDEXED_3DAY_USAGE, - "logs_indexed_3day_percentage" => Self::LOGS_INDEXED_3DAY_PERCENTAGE, - "logs_indexed_1day_usage" => Self::LOGS_INDEXED_1DAY_USAGE, - "logs_indexed_1day_percentage" => Self::LOGS_INDEXED_1DAY_PERCENTAGE, - "rum_ingested_usage" => Self::RUM_INGESTED_USAGE, - "rum_ingested_percentage" => Self::RUM_INGESTED_PERCENTAGE, - "rum_investigate_usage" => Self::RUM_INVESTIGATE_USAGE, - "rum_investigate_percentage" => Self::RUM_INVESTIGATE_PERCENTAGE, - "rum_replay_sessions_usage" => Self::RUM_REPLAY_SESSIONS_USAGE, - "rum_replay_sessions_percentage" => Self::RUM_REPLAY_SESSIONS_PERCENTAGE, - "rum_session_replay_add_on_usage" => Self::RUM_SESSION_REPLAY_ADD_ON_USAGE, - "rum_session_replay_add_on_percentage" => Self::RUM_SESSION_REPLAY_ADD_ON_PERCENTAGE, - "rum_browser_mobile_sessions_usage" => Self::RUM_BROWSER_MOBILE_SESSIONS_USAGE, - "rum_browser_mobile_sessions_percentage" => { - Self::RUM_BROWSER_MOBILE_SESSIONS_PERCENTAGE - } - "ingested_spans_bytes_usage" => Self::INGESTED_SPANS_BYTES_USAGE, - "ingested_spans_bytes_percentage" => Self::INGESTED_SPANS_BYTES_PERCENTAGE, - "siem_analyzed_logs_add_on_usage" => Self::SIEM_ANALYZED_LOGS_ADD_ON_USAGE, - "siem_analyzed_logs_add_on_percentage" => Self::SIEM_ANALYZED_LOGS_ADD_ON_PERCENTAGE, - "siem_ingested_bytes_usage" => Self::SIEM_INGESTED_BYTES_USAGE, - "siem_ingested_bytes_percentage" => Self::SIEM_INGESTED_BYTES_PERCENTAGE, - "workflow_executions_usage" => Self::WORKFLOW_EXECUTIONS_USAGE, - "workflow_executions_percentage" => Self::WORKFLOW_EXECUTIONS_PERCENTAGE, - "sca_fargate_usage" => Self::SCA_FARGATE_USAGE, - "sca_fargate_percentage" => Self::SCA_FARGATE_PERCENTAGE, - "*" => Self::ALL, - _ => Self::UnparsedObject(crate::datadog::UnparsedObject { - value: serde_json::Value::String(s.into()), - }), - }) - } -} diff --git a/src/datadogV1/model/model_monthly_usage_attribution_values.rs b/src/datadogV1/model/model_monthly_usage_attribution_values.rs index 4ab0f552a..bfd762bf9 100644 --- a/src/datadogV1/model/model_monthly_usage_attribution_values.rs +++ b/src/datadogV1/model/model_monthly_usage_attribution_values.rs @@ -7,7 +7,6 @@ use serde_with::skip_serializing_none; use std::fmt::{self, Formatter}; /// Fields in Usage Summary by tag(s). -/// The following values have been **deprecated**: `estimated_indexed_spans_usage`, `estimated_indexed_spans_percentage`, `estimated_ingested_spans_usage`, `estimated_ingested_spans_percentage`. #[non_exhaustive] #[skip_serializing_none] #[derive(Clone, Debug, PartialEq, Serialize)] diff --git a/src/datadogV2/api/api_usage_metering.rs b/src/datadogV2/api/api_usage_metering.rs index 6689c31da..f3954cd6c 100644 --- a/src/datadogV2/api/api_usage_metering.rs +++ b/src/datadogV2/api/api_usage_metering.rs @@ -389,6 +389,14 @@ pub enum GetUsageApplicationSecurityMonitoringError { UnknownValue(serde_json::Value), } +/// GetUsageAttributionTypesError is a struct for typed errors of method [`UsageMeteringAPI::get_usage_attribution_types`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUsageAttributionTypesError { + APIErrorResponse(crate::datadogV2::model::APIErrorResponse), + UnknownValue(serde_json::Value), +} + /// GetUsageLambdaTracedInvocationsError is a struct for typed errors of method [`UsageMeteringAPI::get_usage_lambda_traced_invocations`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -1789,6 +1797,115 @@ impl UsageMeteringAPI { } } + /// Get usage attribution types. + pub async fn get_usage_attribution_types( + &self, + ) -> Result< + crate::datadogV2::model::UsageAttributionTypesResponse, + datadog::Error, + > { + match self.get_usage_attribution_types_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 usage attribution types. + pub async fn get_usage_attribution_types_with_http_info( + &self, + ) -> Result< + datadog::ResponseContent, + datadog::Error, + > { + let local_configuration = &self.config; + let operation_id = "v2.get_usage_attribution_types"; + + let local_client = &self.client; + + let local_uri_str = format!( + "{}/api/v2/usage/usage-attribution-types", + 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;datetime-format=rfc3339"), + ); + + // 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 hourly usage for Lambda traced invocations. /// **Note:** This endpoint has been deprecated.. Hourly usage data for all products is now available in the [Get hourly usage by product family API]() pub async fn get_usage_lambda_traced_invocations( diff --git a/src/datadogV2/model/mod.rs b/src/datadogV2/model/mod.rs index ea0e124a9..9d283a388 100644 --- a/src/datadogV2/model/mod.rs +++ b/src/datadogV2/model/mod.rs @@ -8682,6 +8682,14 @@ pub mod model_projected_cost_attributes; pub use self::model_projected_cost_attributes::ProjectedCostAttributes; pub mod model_projected_cost_type; pub use self::model_projected_cost_type::ProjectedCostType; +pub mod model_usage_attribution_types_response; +pub use self::model_usage_attribution_types_response::UsageAttributionTypesResponse; +pub mod model_usage_attribution_types_body; +pub use self::model_usage_attribution_types_body::UsageAttributionTypesBody; +pub mod model_usage_attribution_types_attributes; +pub use self::model_usage_attribution_types_attributes::UsageAttributionTypesAttributes; +pub mod model_usage_attribution_types_type; +pub use self::model_usage_attribution_types_type::UsageAttributionTypesType; pub mod model_user_invitations_request; pub use self::model_user_invitations_request::UserInvitationsRequest; pub mod model_user_invitation_data; diff --git a/src/datadogV2/model/model_usage_attribution_types_attributes.rs b/src/datadogV2/model/model_usage_attribution_types_attributes.rs new file mode 100644 index 000000000..ce553abab --- /dev/null +++ b/src/datadogV2/model/model_usage_attribution_types_attributes.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}; + +/// List of usage attribution types. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct UsageAttributionTypesAttributes { + /// List of usage attribution types. + #[serde(rename = "values")] + pub values: Option>, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl UsageAttributionTypesAttributes { + pub fn new() -> UsageAttributionTypesAttributes { + UsageAttributionTypesAttributes { + values: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn values(mut self, value: Vec) -> Self { + self.values = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for UsageAttributionTypesAttributes { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for UsageAttributionTypesAttributes { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct UsageAttributionTypesAttributesVisitor; + impl<'a> Visitor<'a> for UsageAttributionTypesAttributesVisitor { + type Value = UsageAttributionTypesAttributes; + + 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 values: 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() { + "values" => { + if v.is_null() { + continue; + } + values = 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 = UsageAttributionTypesAttributes { + values, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(UsageAttributionTypesAttributesVisitor) + } +} diff --git a/src/datadogV2/model/model_usage_attribution_types_body.rs b/src/datadogV2/model/model_usage_attribution_types_body.rs new file mode 100644 index 000000000..bfc0e5bcc --- /dev/null +++ b/src/datadogV2/model/model_usage_attribution_types_body.rs @@ -0,0 +1,152 @@ +// 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}; + +/// Usage attribution types data. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct UsageAttributionTypesBody { + /// List of usage attribution types. + #[serde(rename = "attributes")] + pub attributes: Option, + /// Unique ID of the response. + #[serde(rename = "id")] + pub id: Option, + /// Type of usage attribution types data. + #[serde(rename = "type")] + pub type_: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl UsageAttributionTypesBody { + pub fn new() -> UsageAttributionTypesBody { + UsageAttributionTypesBody { + attributes: None, + id: None, + type_: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn attributes( + mut self, + value: crate::datadogV2::model::UsageAttributionTypesAttributes, + ) -> Self { + self.attributes = Some(value); + self + } + + pub fn id(mut self, value: String) -> Self { + self.id = Some(value); + self + } + + pub fn type_(mut self, value: crate::datadogV2::model::UsageAttributionTypesType) -> 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 UsageAttributionTypesBody { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for UsageAttributionTypesBody { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct UsageAttributionTypesBodyVisitor; + impl<'a> Visitor<'a> for UsageAttributionTypesBodyVisitor { + type Value = UsageAttributionTypesBody; + + 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::UsageAttributionTypesAttributes, + > = 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" => { + 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::UsageAttributionTypesType::UnparsedObject(_type_) => { + _unparsed = true; + }, + _ => {} + } + } + } + &_ => { + if let Ok(value) = serde_json::from_value(v.clone()) { + additional_properties.insert(k, value); + } + } + } + } + + let content = UsageAttributionTypesBody { + attributes, + id, + type_, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(UsageAttributionTypesBodyVisitor) + } +} diff --git a/src/datadogV2/model/model_usage_attribution_types_response.rs b/src/datadogV2/model/model_usage_attribution_types_response.rs new file mode 100644 index 000000000..42d178013 --- /dev/null +++ b/src/datadogV2/model/model_usage_attribution_types_response.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}; + +/// Usage attribution types response. +#[non_exhaustive] +#[skip_serializing_none] +#[derive(Clone, Debug, PartialEq, Serialize)] +pub struct UsageAttributionTypesResponse { + /// Usage attribution types data. + #[serde(rename = "data")] + pub data: Option, + #[serde(flatten)] + pub additional_properties: std::collections::BTreeMap, + #[serde(skip)] + #[serde(default)] + pub(crate) _unparsed: bool, +} + +impl UsageAttributionTypesResponse { + pub fn new() -> UsageAttributionTypesResponse { + UsageAttributionTypesResponse { + data: None, + additional_properties: std::collections::BTreeMap::new(), + _unparsed: false, + } + } + + pub fn data(mut self, value: crate::datadogV2::model::UsageAttributionTypesBody) -> Self { + self.data = Some(value); + self + } + + pub fn additional_properties( + mut self, + value: std::collections::BTreeMap, + ) -> Self { + self.additional_properties = value; + self + } +} + +impl Default for UsageAttributionTypesResponse { + fn default() -> Self { + Self::new() + } +} + +impl<'de> Deserialize<'de> for UsageAttributionTypesResponse { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + struct UsageAttributionTypesResponseVisitor; + impl<'a> Visitor<'a> for UsageAttributionTypesResponseVisitor { + type Value = UsageAttributionTypesResponse; + + 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" => { + if v.is_null() { + continue; + } + 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 content = UsageAttributionTypesResponse { + data, + additional_properties, + _unparsed, + }; + + Ok(content) + } + } + + deserializer.deserialize_any(UsageAttributionTypesResponseVisitor) + } +} diff --git a/src/datadogV2/model/model_usage_attribution_types_type.rs b/src/datadogV2/model/model_usage_attribution_types_type.rs new file mode 100644 index 000000000..2f20b6b7e --- /dev/null +++ b/src/datadogV2/model/model_usage_attribution_types_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 UsageAttributionTypesType { + USAGE_ATTRIBUTION_TYPES, + UnparsedObject(crate::datadog::UnparsedObject), +} + +impl ToString for UsageAttributionTypesType { + fn to_string(&self) -> String { + match self { + Self::USAGE_ATTRIBUTION_TYPES => String::from("usage_attribution_types"), + Self::UnparsedObject(v) => v.value.to_string(), + } + } +} + +impl Serialize for UsageAttributionTypesType { + 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 UsageAttributionTypesType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s: String = String::deserialize(deserializer)?; + Ok(match s.as_str() { + "usage_attribution_types" => Self::USAGE_ATTRIBUTION_TYPES, + _ => Self::UnparsedObject(crate::datadog::UnparsedObject { + value: serde_json::Value::String(s.into()), + }), + }) + } +} diff --git a/tests/scenarios/features/v2/undo.json b/tests/scenarios/features/v2/undo.json index 09186eef6..9512abf9d 100644 --- a/tests/scenarios/features/v2/undo.json +++ b/tests/scenarios/features/v2/undo.json @@ -5951,6 +5951,12 @@ "type": "safe" } }, + "GetUsageAttributionTypes": { + "tag": "Usage Metering", + "undo": { + "type": "safe" + } + }, "SendInvitations": { "tag": "Users", "undo": { diff --git a/tests/scenarios/features/v2/usage_metering.feature b/tests/scenarios/features/v2/usage_metering.feature index 715f443ee..d953a11c0 100644 --- a/tests/scenarios/features/v2/usage_metering.feature +++ b/tests/scenarios/features/v2/usage_metering.feature @@ -197,6 +197,12 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/revenue-query + Scenario: Get usage attribution types returns "OK" response + Given new "GetUsageAttributionTypes" request + When the request is sent + Then the response status is 200 OK + @team:DataDog/revenue-query Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response Given new "GetEstimatedCostByOrg" request diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index dbafb6667..8ab3f42b8 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -3148,6 +3148,10 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { world .function_mappings .insert("v2.GetProjectedCost".into(), test_v2_get_projected_cost); + world.function_mappings.insert( + "v2.GetUsageAttributionTypes".into(), + test_v2_get_usage_attribution_types, + ); world .function_mappings .insert("v2.ListAllCSMAgents".into(), test_v2_list_all_csm_agents); @@ -22874,6 +22878,33 @@ fn test_v2_get_projected_cost(world: &mut DatadogWorld, _parameters: &HashMap, +) { + let api = world + .api_instances + .v2_api_usage_metering + .as_ref() + .expect("api instance not found"); + let response = match block_on(api.get_usage_attribution_types_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_list_all_csm_agents(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances