From 07726bf98b612385ab9ce87745f523a158d45254 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 22 Mar 2024 16:40:26 +0000 Subject: [PATCH] Regenerate client from commit 270f7b6b of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 577 ---------- ...v1_usage-metering_get_usage_attribution.rs | 25 - src/datadogV1/api/api_usage_metering.rs | 191 ---- src/datadogV1/model/mod.rs | 18 +- .../model/model_usage_attribution_body.rs | 194 ---- .../model/model_usage_attribution_metadata.rs | 111 -- .../model_usage_attribution_pagination.rs | 155 --- .../model/model_usage_attribution_response.rs | 102 -- .../model/model_usage_attribution_sort.rs | 181 --- ...del_usage_attribution_supported_metrics.rs | 214 ---- .../model/model_usage_attribution_values.rs | 1002 ----------------- tests/scenarios/features/v1/undo.json | 6 - .../features/v1/usage_metering.feature | 10 - tests/scenarios/function_mappings.rs | 58 - 15 files changed, 6 insertions(+), 2846 deletions(-) delete mode 100644 examples/v1_usage-metering_get_usage_attribution.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_body.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_metadata.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_pagination.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_response.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_sort.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_supported_metrics.rs delete mode 100644 src/datadogV1/model/model_usage_attribution_values.rs diff --git a/.apigentools-info b/.apigentools-info index 032a6664b..c6f067165 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-03-22 15:34:49.536706", - "spec_repo_commit": "24998b49" + "regenerated": "2024-03-22 16:35:22.780414", + "spec_repo_commit": "270f7b6b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-03-22 15:34:49.554368", - "spec_repo_commit": "24998b49" + "regenerated": "2024-03-22 16:35:22.800380", + "spec_repo_commit": "270f7b6b" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3cb57f34d..4d5f1a44a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -16819,270 +16819,6 @@ components: format: double type: number type: object - UsageAttributionBody: - description: Usage Summary by tag for a given organization. - properties: - month: - description: 'Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM].' - format: date-time - type: string - org_name: - description: The name of the organization. - type: string - public_id: - description: The organization public ID. - type: string - tag_config_source: - description: The source of the usage attribution tag configuration and the - selected tags in the format `::://////`. - type: string - tags: - $ref: '#/components/schemas/UsageAttributionTagNames' - updated_at: - description: Shows the the most recent hour in the current month for all - organizations for which all usages were calculated. - type: string - values: - $ref: '#/components/schemas/UsageAttributionValues' - type: object - UsageAttributionLimit: - default: 5000 - description: Maximum number of records to be returned. - format: int64 - type: integer - UsageAttributionMetadata: - description: The object containing document metadata. - properties: - aggregates: - $ref: '#/components/schemas/UsageAttributionAggregates' - pagination: - $ref: '#/components/schemas/UsageAttributionPagination' - type: object - UsageAttributionOffset: - default: 0 - description: Number of records to skip before beginning to return. - format: int64 - type: integer - UsageAttributionPagination: - description: The metadata for the current pagination. - properties: - limit: - description: Maximum amount of records to be returned. - format: int64 - type: integer - offset: - description: Records to be skipped before beginning to return. - format: int64 - type: integer - sort_direction: - description: Direction to sort by. - type: string - sort_name: - description: Field to sort by. - type: string - total_number_of_records: - description: Total number of records. - format: int64 - type: integer - type: object - UsageAttributionResponse: - description: Response containing the Usage Summary by tag(s). - properties: - metadata: - $ref: '#/components/schemas/UsageAttributionMetadata' - usage: - description: Get usage summary by tag(s). - items: - $ref: '#/components/schemas/UsageAttributionBody' - type: array - type: object - UsageAttributionSort: - default: custom_timeseries_usage - description: The field to sort by. - enum: - - api_percentage - - snmp_usage - - apm_host_usage - - api_usage - - appsec_usage - - appsec_percentage - - container_usage - - custom_timeseries_percentage - - container_percentage - - apm_host_percentage - - npm_host_percentage - - browser_percentage - - browser_usage - - infra_host_percentage - - snmp_percentage - - npm_host_usage - - infra_host_usage - - custom_timeseries_usage - - lambda_functions_usage - - lambda_functions_percentage - - lambda_invocations_usage - - lambda_invocations_percentage - - estimated_indexed_logs_usage - - estimated_indexed_logs_percentage - - estimated_ingested_logs_usage - - estimated_ingested_logs_percentage - - estimated_indexed_spans_usage - - estimated_indexed_spans_percentage - - estimated_ingested_spans_usage - - estimated_ingested_spans_percentage - - apm_fargate_usage - - apm_fargate_percentage - - appsec_fargate_usage - - appsec_fargate_percentage - - estimated_rum_usage_attribution_usage - - estimated_rum_usage_attribution_percentage - - asm_serverless_traced_invocations_usage - - asm_serverless_traced_invocations_percentage - type: string - x-enum-varnames: - - API_PERCENTAGE - - SNMP_USAGE - - APM_HOST_USAGE - - API_USAGE - - APPSEC_USAGE - - APPSEC_PERCENTAGE - - CONTAINER_USAGE - - CUSTOM_TIMESERIES_PERCENTAGE - - CONTAINER_PERCENTAGE - - APM_HOST_PERCENTAGE - - NPM_HOST_PERCENTAGE - - BROWSER_PERCENTAGE - - BROWSER_USAGE - - INFRA_HOST_PERCENTAGE - - SNMP_PERCENTAGE - - NPM_HOST_USAGE - - INFRA_HOST_USAGE - - CUSTOM_TIMESERIES_USAGE - - LAMBDA_FUNCTIONS_USAGE - - LAMBDA_FUNCTIONS_PERCENTAGE - - LAMBDA_INVOCATIONS_USAGE - - LAMBDA_INVOCATIONS_PERCENTAGE - - ESTIMATED_INDEXED_LOGS_USAGE - - ESTIMATED_INDEXED_LOGS_PERCENTAGE - - ESTIMATED_INGESTED_LOGS_USAGE - - ESTIMATED_INGESTED_LOGS_PERCENTAGE - - ESTIMATED_INDEXED_SPANS_USAGE - - ESTIMATED_INDEXED_SPANS_PERCENTAGE - - ESTIMATED_INGESTED_SPANS_USAGE - - ESTIMATED_INGESTED_SPANS_PERCENTAGE - - APM_FARGATE_USAGE - - APM_FARGATE_PERCENTAGE - - APPSEC_FARGATE_USAGE - - APPSEC_FARGATE_PERCENTAGE - - ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE - - ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - UsageAttributionSupportedMetrics: - description: Supported fields for usage attribution requests (valid requests - contain one or more metrics, or `*` for all). - enum: - - custom_timeseries_usage - - container_usage - - snmp_percentage - - apm_host_usage - - browser_usage - - npm_host_percentage - - infra_host_usage - - custom_timeseries_percentage - - container_percentage - - api_usage - - apm_host_percentage - - infra_host_percentage - - snmp_usage - - browser_percentage - - api_percentage - - npm_host_usage - - lambda_functions_usage - - lambda_functions_percentage - - lambda_invocations_usage - - lambda_invocations_percentage - - fargate_usage - - fargate_percentage - - profiled_host_usage - - profiled_host_percentage - - profiled_container_usage - - profiled_container_percentage - - dbm_hosts_usage - - dbm_hosts_percentage - - dbm_queries_usage - - dbm_queries_percentage - - estimated_indexed_logs_usage - - estimated_indexed_logs_percentage - - estimated_ingested_logs_usage - - estimated_ingested_logs_percentage - - appsec_usage - - appsec_percentage - - estimated_indexed_spans_usage - - estimated_indexed_spans_percentage - - estimated_ingested_spans_usage - - estimated_ingested_spans_percentage - - apm_fargate_usage - - apm_fargate_percentage - - appsec_fargate_usage - - appsec_fargate_percentage - - estimated_rum_usage_attribution_usage - - estimated_rum_usage_attribution_percentage - - asm_serverless_traced_invocations_usage - - asm_serverless_traced_invocations_percentage - - '*' - type: string - x-enum-varnames: - - CUSTOM_TIMESERIES_USAGE - - CONTAINER_USAGE - - SNMP_PERCENTAGE - - APM_HOST_USAGE - - BROWSER_USAGE - - NPM_HOST_PERCENTAGE - - INFRA_HOST_USAGE - - CUSTOM_TIMESERIES_PERCENTAGE - - CONTAINER_PERCENTAGE - - API_USAGE - - APM_HOST_PERCENTAGE - - INFRA_HOST_PERCENTAGE - - SNMP_USAGE - - BROWSER_PERCENTAGE - - API_PERCENTAGE - - NPM_HOST_USAGE - - LAMBDA_FUNCTIONS_USAGE - - LAMBDA_FUNCTIONS_PERCENTAGE - - LAMBDA_INVOCATIONS_USAGE - - LAMBDA_INVOCATIONS_PERCENTAGE - - FARGATE_USAGE - - FARGATE_PERCENTAGE - - PROFILED_HOST_USAGE - - PROFILED_HOST_PERCENTAGE - - PROFILED_CONTAINER_USAGE - - PROFILED_CONTAINER_PERCENTAGE - - DBM_HOSTS_USAGE - - DBM_HOSTS_PERCENTAGE - - DBM_QUERIES_USAGE - - DBM_QUERIES_PERCENTAGE - - ESTIMATED_INDEXED_LOGS_USAGE - - ESTIMATED_INDEXED_LOGS_PERCENTAGE - - ESTIMATED_INGESTED_LOGS_USAGE - - ESTIMATED_INGESTED_LOGS_PERCENTAGE - - APPSEC_USAGE - - APPSEC_PERCENTAGE - - ESTIMATED_INDEXED_SPANS_USAGE - - ESTIMATED_INDEXED_SPANS_PERCENTAGE - - ESTIMATED_INGESTED_SPANS_USAGE - - ESTIMATED_INGESTED_SPANS_PERCENTAGE - - APM_FARGATE_USAGE - - APM_FARGATE_PERCENTAGE - - APPSEC_FARGATE_USAGE - - APPSEC_FARGATE_PERCENTAGE - - ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE - - ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - - ALL UsageAttributionTagNames: additionalProperties: description: 'A list of values that are associated with each tag key. @@ -17112,225 +16848,6 @@ components: In this scenario the API returns the total usage, not broken down by tags.' nullable: true type: object - UsageAttributionValues: - description: Fields in Usage Summary by tag(s). - properties: - api_percentage: - description: The percentage of synthetic API test usage by tag(s). - format: double - type: number - api_usage: - description: The synthetic API test usage by tag(s). - format: double - type: number - apm_fargate_percentage: - description: The percentage of APM ECS Fargate task usage by tag(s). - format: double - type: number - apm_fargate_usage: - description: The APM ECS Fargate task usage by tag(s). - format: double - type: number - apm_host_percentage: - description: The percentage of APM host usage by tag(s). - format: double - type: number - apm_host_usage: - description: The APM host usage by tag(s). - format: double - type: number - appsec_fargate_percentage: - description: The percentage of Application Security Monitoring ECS Fargate - task usage by tag(s). - format: double - type: number - appsec_fargate_usage: - description: The Application Security Monitoring ECS Fargate task usage - by tag(s). - format: double - type: number - appsec_percentage: - description: The percentage of Application Security Monitoring host usage - by tag(s). - format: double - type: number - appsec_usage: - description: The Application Security Monitoring host usage by tag(s). - format: double - type: number - browser_percentage: - description: The percentage of synthetic browser test usage by tag(s). - format: double - type: number - browser_usage: - description: The synthetic browser test usage by tag(s). - format: double - type: number - container_percentage: - description: The percentage of container usage by tag(s). - format: double - type: number - container_usage: - description: The container usage by tag(s). - format: double - type: number - cspm_container_percentage: - description: The percentage of Cloud Security Management Pro container usage - by tag(s) - format: double - type: number - cspm_container_usage: - description: The Cloud Security Management Pro container usage by tag(s) - format: double - type: number - cspm_host_percentage: - description: The percentage of Cloud Security Management Pro host usage - by tag(s) - format: double - type: number - cspm_host_usage: - description: The Cloud Security Management Pro host usage by tag(s) - format: double - type: number - custom_timeseries_percentage: - description: The percentage of custom metrics usage by tag(s). - format: double - type: number - custom_timeseries_usage: - description: The custom metrics usage by tag(s). - format: double - type: number - cws_container_percentage: - description: The percentage of Cloud Workload Security container usage by - tag(s) - format: double - type: number - cws_container_usage: - description: The Cloud Workload Security container usage by tag(s) - format: double - type: number - cws_host_percentage: - description: The percentage of Cloud Workload Security host usage by tag(s) - format: double - type: number - cws_host_usage: - description: The Cloud Workload Security host usage by tag(s) - format: double - type: number - dbm_hosts_percentage: - description: The percentage of Database Monitoring host usage by tag(s). - format: double - type: number - dbm_hosts_usage: - description: The Database Monitoring host usage by tag(s). - format: double - type: number - dbm_queries_percentage: - description: The percentage of Database Monitoring normalized queries usage - by tag(s). - format: double - type: number - dbm_queries_usage: - description: The Database Monitoring normalized queries usage by tag(s). - format: double - type: number - estimated_indexed_logs_percentage: - description: The percentage of estimated live indexed logs usage by tag(s). - format: double - type: number - estimated_indexed_logs_usage: - description: The estimated live indexed logs usage by tag(s). - format: double - type: number - estimated_indexed_spans_percentage: - description: The percentage of estimated indexed spans usage by tag(s). - format: double - type: number - estimated_indexed_spans_usage: - description: The estimated indexed spans usage by tag(s). - format: double - type: number - estimated_ingested_logs_percentage: - description: The percentage of estimated live ingested logs usage by tag(s). - format: double - type: number - estimated_ingested_logs_usage: - description: The estimated live ingested logs usage by tag(s). - format: double - type: number - estimated_ingested_spans_percentage: - description: The percentage of estimated ingested spans usage by tag(s). - format: double - type: number - estimated_ingested_spans_usage: - description: The estimated ingested spans usage by tag(s). - format: double - type: number - estimated_rum_sessions_percentage: - description: The percentage of estimated rum sessions usage by tag(s). - format: double - type: number - estimated_rum_sessions_usage: - description: The estimated rum sessions usage by tag(s). - format: double - type: number - infra_host_percentage: - description: The percentage of infrastructure host usage by tag(s). - format: double - type: number - infra_host_usage: - description: The infrastructure host usage by tag(s). - format: double - type: number - lambda_functions_percentage: - description: The percentage of Lambda function usage by tag(s). - format: double - type: number - lambda_functions_usage: - description: The Lambda function usage by tag(s). - format: double - type: number - lambda_invocations_percentage: - description: The percentage of Lambda invocation usage by tag(s). - format: double - type: number - lambda_invocations_usage: - description: The Lambda invocation usage by tag(s). - format: double - type: number - npm_host_percentage: - description: The percentage of network host usage by tag(s). - format: double - type: number - npm_host_usage: - description: The network host usage by tag(s). - format: double - type: number - profiled_container_percentage: - description: The percentage of profiled containers usage by tag(s). - format: double - type: number - profiled_container_usage: - description: The profiled container usage by tag(s). - format: double - type: number - profiled_hosts_percentage: - description: The percentage of profiled hosts usage by tag(s). - format: double - type: number - profiled_hosts_usage: - description: The profiled host usage by tag(s). - format: double - type: number - snmp_percentage: - description: The percentage of network device usage by tag(s). - format: double - type: number - snmp_usage: - description: The network device usage by tag(s). - format: double - type: number - type: object UsageAuditLogsHour: description: Audit logs usage for a given organization for a given hour. properties: @@ -31220,100 +30737,6 @@ paths: summary: Get hourly usage for analyzed logs tags: - Usage Metering - /api/v1/usage/attribution: - get: - deprecated: true - description: 'Get usage attribution. - - **Note:** This endpoint will be fully deprecated on December 1, 2022. - - Refer to [Migrating from v1 to v2 of the Usage Attribution API](https://docs.datadoghq.com/account_management/guide/usage-attribution-migration/) - for the associated migration guide.' - operationId: GetUsageAttribution - parameters: - - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` - for usage beginning in this month. - - Maximum of 15 months ago.' - in: query - name: start_month - required: true - schema: - format: date-time - type: string - - description: Comma-separated list of usage types to return, or `*` for all - usage types. - in: query - name: fields - required: true - schema: - $ref: '#/components/schemas/UsageAttributionSupportedMetrics' - - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` - for usage ending this month.' - in: query - name: end_month - required: false - schema: - format: date-time - type: string - - description: 'The direction to sort by: `[desc, asc]`.' - in: query - name: sort_direction - required: false - schema: - $ref: '#/components/schemas/UsageSortDirection' - - description: The field to sort by. - in: query - name: sort_name - required: false - schema: - $ref: '#/components/schemas/UsageAttributionSort' - - description: Include child org usage in the response. Defaults to false. - in: query - name: include_descendants - required: false - schema: - default: false - type: boolean - - description: Number of records to skip before beginning to return. - in: query - name: offset - required: false - schema: - $ref: '#/components/schemas/UsageAttributionOffset' - - description: Maximum number of records to be returned. - in: query - name: limit - required: false - schema: - $ref: '#/components/schemas/UsageAttributionLimit' - responses: - '200': - content: - application/json;datetime-format=rfc3339: - schema: - $ref: '#/components/schemas/UsageAttributionResponse' - 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 - tags: - - Usage Metering /api/v1/usage/audit_logs: get: deprecated: true diff --git a/examples/v1_usage-metering_get_usage_attribution.rs b/examples/v1_usage-metering_get_usage_attribution.rs deleted file mode 100644 index 7caa9e552..000000000 --- a/examples/v1_usage-metering_get_usage_attribution.rs +++ /dev/null @@ -1,25 +0,0 @@ -// Get usage attribution returns "OK" response -use datadog_api_client::datadog::configuration::Configuration; -use datadog_api_client::datadogV1::api::api_usage_metering::GetUsageAttributionOptionalParams; -use datadog_api_client::datadogV1::api::api_usage_metering::UsageMeteringAPI; -use datadog_api_client::datadogV1::model::UsageAttributionSupportedMetrics; - -#[tokio::main] -async fn main() { - let configuration = Configuration::new(); - let api = UsageMeteringAPI::with_config(configuration); - let resp = api - .get_usage_attribution( - "2021-11-08T11:11:11+00:00".to_string(), - UsageAttributionSupportedMetrics::ALL, - GetUsageAttributionOptionalParams::default() - .offset(0) - .limit(1), - ) - .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 e2364308d..9df6a786d 100644 --- a/src/datadogV1/api/api_usage_metering.rs +++ b/src/datadogV1/api/api_usage_metering.rs @@ -234,57 +234,6 @@ impl GetUsageAnalyzedLogsOptionalParams { } } -/// GetUsageAttributionOptionalParams is a struct for passing parameters to the method [`UsageMeteringAPI::get_usage_attribution`] -#[non_exhaustive] -#[derive(Clone, Default, Debug)] -pub struct GetUsageAttributionOptionalParams { - /// Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. - pub end_month: Option, - /// The direction to sort by: `[desc, asc]`. - pub sort_direction: Option, - /// The field to sort by. - pub sort_name: Option, - /// Include child org usage in the response. Defaults to false. - pub include_descendants: Option, - /// Number of records to skip before beginning to return. - pub offset: Option, - /// Maximum number of records to be returned. - pub limit: Option, -} - -impl GetUsageAttributionOptionalParams { - /// Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage ending this month. - pub fn end_month(mut self, value: String) -> Self { - self.end_month = Some(value); - self - } - /// The direction to sort by: `[desc, asc]`. - pub fn sort_direction(mut self, value: crate::datadogV1::model::UsageSortDirection) -> Self { - self.sort_direction = Some(value); - self - } - /// The field to sort by. - pub fn sort_name(mut self, value: crate::datadogV1::model::UsageAttributionSort) -> Self { - self.sort_name = Some(value); - self - } - /// Include child org usage in the response. Defaults to false. - pub fn include_descendants(mut self, value: bool) -> Self { - self.include_descendants = Some(value); - self - } - /// Number of records to skip before beginning to return. - pub fn offset(mut self, value: i64) -> Self { - self.offset = Some(value); - self - } - /// Maximum number of records to be returned. - pub fn limit(mut self, value: i64) -> Self { - self.limit = Some(value); - self - } -} - /// GetUsageAuditLogsOptionalParams is a struct for passing parameters to the method [`UsageMeteringAPI::get_usage_audit_logs`] #[non_exhaustive] #[derive(Clone, Default, Debug)] @@ -893,15 +842,6 @@ pub enum GetUsageAnalyzedLogsError { UnknownValue(serde_json::Value), } -/// GetUsageAttributionError is a struct for typed errors of method [`UsageMeteringAPI::get_usage_attribution`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetUsageAttributionError { - Status403(Option), - Status429(Option), - UnknownValue(serde_json::Value), -} - /// GetUsageAuditLogsError is a struct for typed errors of method [`UsageMeteringAPI::get_usage_audit_logs`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -2249,137 +2189,6 @@ impl UsageMeteringAPI { } } - /// Get usage attribution. - /// **Note:** This endpoint will be fully deprecated on December 1, 2022. - /// Refer to [Migrating from v1 to v2 of the Usage Attribution API]() for the associated migration guide. - pub async fn get_usage_attribution( - &self, - start_month: String, - fields: crate::datadogV1::model::UsageAttributionSupportedMetrics, - params: GetUsageAttributionOptionalParams, - ) -> Result> - { - match self - .get_usage_attribution_with_http_info(start_month, fields, params) - .await - { - Ok(response_content) => { - if let Some(e) = response_content.entity { - Ok(e) - } else { - Err(Error::Serde(serde::de::Error::custom( - "response content was None", - ))) - } - } - Err(err) => Err(err), - } - } - - /// Get usage attribution. - /// **Note:** This endpoint will be fully deprecated on December 1, 2022. - /// Refer to [Migrating from v1 to v2 of the Usage Attribution API]() for the associated migration guide. - pub async fn get_usage_attribution_with_http_info( - &self, - start_month: String, - fields: crate::datadogV1::model::UsageAttributionSupportedMetrics, - params: GetUsageAttributionOptionalParams, - ) -> Result< - ResponseContent, - Error, - > { - let local_configuration = &self.config; - let operation_id = "v1.get_usage_attribution"; - - // unbox and build optional parameters - let end_month = params.end_month; - let sort_direction = params.sort_direction; - let sort_name = params.sort_name; - let include_descendants = params.include_descendants; - let offset = params.offset; - let limit = params.limit; - - let local_client = &self.client; - - let local_uri_str = format!( - "{}/api/v1/usage/attribution", - local_configuration.get_operation_host(operation_id) - ); - let mut local_req_builder = - local_client.request(reqwest::Method::GET, local_uri_str.as_str()); - - local_req_builder = local_req_builder.query(&[("start_month", &start_month.to_string())]); - local_req_builder = local_req_builder.query(&[("fields", &fields.to_string())]); - if let Some(ref local_query_param) = end_month { - local_req_builder = - local_req_builder.query(&[("end_month", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = sort_direction { - local_req_builder = - local_req_builder.query(&[("sort_direction", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = sort_name { - local_req_builder = - local_req_builder.query(&[("sort_name", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = include_descendants { - local_req_builder = - local_req_builder.query(&[("include_descendants", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = offset { - local_req_builder = - local_req_builder.query(&[("offset", &local_query_param.to_string())]); - }; - if let Some(ref local_query_param) = limit { - local_req_builder = - local_req_builder.query(&[("limit", &local_query_param.to_string())]); - }; - - // build user agent - local_req_builder = local_req_builder.header( - reqwest::header::USER_AGENT, - local_configuration.user_agent.clone(), - ); - - // build auth - if let Some(local_key) = local_configuration.auth_keys.get("apiKeyAuth") { - local_req_builder = local_req_builder.header("DD-API-KEY", &local_key.key); - }; - if let Some(local_key) = local_configuration.auth_keys.get("appKeyAuth") { - local_req_builder = local_req_builder.header("DD-APPLICATION-KEY", &local_key.key); - }; - - let local_req = local_req_builder.build()?; - let local_resp = local_client.execute(local_req).await?; - - let local_status = local_resp.status(); - let local_content = local_resp.text().await?; - - if !local_status.is_client_error() && !local_status.is_server_error() { - match serde_json::from_str::( - &local_content, - ) { - Ok(e) => { - return Ok(ResponseContent { - status: local_status, - content: local_content, - entity: Some(e), - }) - } - Err(e) => return Err(crate::datadog::Error::Serde(e)), - }; - } else { - let local_entity: Option = - serde_json::from_str(&local_content).ok(); - let local_error = ResponseContent { - status: local_status, - content: local_content, - entity: local_entity, - }; - Err(Error::ResponseError(local_error)) - } - } - /// Get hourly usage for audit logs. /// **Note:** This endpoint has been deprecated. pub async fn get_usage_audit_logs( diff --git a/src/datadogV1/model/mod.rs b/src/datadogV1/model/mod.rs index 6cec703fa..05556b353 100644 --- a/src/datadogV1/model/mod.rs +++ b/src/datadogV1/model/mod.rs @@ -1486,22 +1486,6 @@ pub mod model_usage_analyzed_logs_response; pub use self::model_usage_analyzed_logs_response::UsageAnalyzedLogsResponse; pub mod model_usage_analyzed_logs_hour; pub use self::model_usage_analyzed_logs_hour::UsageAnalyzedLogsHour; -pub mod model_usage_attribution_supported_metrics; -pub use self::model_usage_attribution_supported_metrics::UsageAttributionSupportedMetrics; -pub mod model_usage_attribution_sort; -pub use self::model_usage_attribution_sort::UsageAttributionSort; -pub mod model_usage_attribution_response; -pub use self::model_usage_attribution_response::UsageAttributionResponse; -pub mod model_usage_attribution_metadata; -pub use self::model_usage_attribution_metadata::UsageAttributionMetadata; -pub mod model_usage_attribution_aggregates_body; -pub use self::model_usage_attribution_aggregates_body::UsageAttributionAggregatesBody; -pub mod model_usage_attribution_pagination; -pub use self::model_usage_attribution_pagination::UsageAttributionPagination; -pub mod model_usage_attribution_body; -pub use self::model_usage_attribution_body::UsageAttributionBody; -pub mod model_usage_attribution_values; -pub use self::model_usage_attribution_values::UsageAttributionValues; pub mod model_usage_audit_logs_response; pub use self::model_usage_audit_logs_response::UsageAuditLogsResponse; pub mod model_usage_audit_logs_hour; @@ -1586,6 +1570,8 @@ pub mod model_monthly_usage_attribution_response; pub use self::model_monthly_usage_attribution_response::MonthlyUsageAttributionResponse; pub mod model_monthly_usage_attribution_metadata; pub use self::model_monthly_usage_attribution_metadata::MonthlyUsageAttributionMetadata; +pub mod model_usage_attribution_aggregates_body; +pub use self::model_usage_attribution_aggregates_body::UsageAttributionAggregatesBody; pub mod model_monthly_usage_attribution_pagination; pub use self::model_monthly_usage_attribution_pagination::MonthlyUsageAttributionPagination; pub mod model_monthly_usage_attribution_body; diff --git a/src/datadogV1/model/model_usage_attribution_body.rs b/src/datadogV1/model/model_usage_attribution_body.rs deleted file mode 100644 index 28a7a3b15..000000000 --- a/src/datadogV1/model/model_usage_attribution_body.rs +++ /dev/null @@ -1,194 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Usage Summary by tag for a given organization. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct UsageAttributionBody { - /// Datetime in ISO-8601 format, UTC, precise to month: [YYYY-MM]. - #[serde(rename = "month")] - pub month: Option, - /// The name of the organization. - #[serde(rename = "org_name")] - pub org_name: Option, - /// The organization public ID. - #[serde(rename = "public_id")] - pub public_id: Option, - /// The source of the usage attribution tag configuration and the selected tags in the format `::://////`. - #[serde(rename = "tag_config_source")] - pub tag_config_source: Option, - /// Tag keys and values. - /// - /// A `null` value here means that the requested tag breakdown cannot be applied because it does not match the [tags - /// configured for usage attribution](). - /// In this scenario the API returns the total usage, not broken down by tags. - #[serde(rename = "tags", default, with = "::serde_with::rust::double_option")] - pub tags: Option>>>>, - /// Shows the the most recent hour in the current month for all organizations for which all usages were calculated. - #[serde(rename = "updated_at")] - pub updated_at: Option, - /// Fields in Usage Summary by tag(s). - #[serde(rename = "values")] - pub values: Option, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl UsageAttributionBody { - pub fn new() -> UsageAttributionBody { - UsageAttributionBody { - month: None, - org_name: None, - public_id: None, - tag_config_source: None, - tags: None, - updated_at: None, - values: None, - _unparsed: false, - } - } - - pub fn month(mut self, value: String) -> Self { - self.month = Some(value); - self - } - - pub fn org_name(mut self, value: String) -> Self { - self.org_name = Some(value); - self - } - - pub fn public_id(mut self, value: String) -> Self { - self.public_id = Some(value); - self - } - - pub fn tag_config_source(mut self, value: String) -> Self { - self.tag_config_source = Some(value); - self - } - - pub fn tags( - mut self, - value: Option>>>, - ) -> Self { - self.tags = Some(value); - self - } - - pub fn updated_at(mut self, value: String) -> Self { - self.updated_at = Some(value); - self - } - - pub fn values(mut self, value: crate::datadogV1::model::UsageAttributionValues) -> Self { - self.values = Some(value); - self - } -} - -impl Default for UsageAttributionBody { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for UsageAttributionBody { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct UsageAttributionBodyVisitor; - impl<'a> Visitor<'a> for UsageAttributionBodyVisitor { - type Value = UsageAttributionBody; - - 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 month: Option = None; - let mut org_name: Option = None; - let mut public_id: Option = None; - let mut tag_config_source: Option = None; - let mut tags: Option< - Option>>>, - > = None; - let mut updated_at: Option = None; - let mut values: Option = None; - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "month" => { - if v.is_null() { - continue; - } - month = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "org_name" => { - if v.is_null() { - continue; - } - org_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "public_id" => { - if v.is_null() { - continue; - } - public_id = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "tag_config_source" => { - if v.is_null() { - continue; - } - tag_config_source = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "tags" => { - tags = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "updated_at" => { - if v.is_null() { - continue; - } - updated_at = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "values" => { - if v.is_null() { - continue; - } - values = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - &_ => {} - } - } - - let content = UsageAttributionBody { - month, - org_name, - public_id, - tag_config_source, - tags, - updated_at, - values, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(UsageAttributionBodyVisitor) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_metadata.rs b/src/datadogV1/model/model_usage_attribution_metadata.rs deleted file mode 100644 index 7321137d6..000000000 --- a/src/datadogV1/model/model_usage_attribution_metadata.rs +++ /dev/null @@ -1,111 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// The object containing document metadata. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct UsageAttributionMetadata { - /// An array of available aggregates. - #[serde(rename = "aggregates")] - pub aggregates: Option>, - /// The metadata for the current pagination. - #[serde(rename = "pagination")] - pub pagination: Option, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl UsageAttributionMetadata { - pub fn new() -> UsageAttributionMetadata { - UsageAttributionMetadata { - aggregates: None, - pagination: None, - _unparsed: false, - } - } - - pub fn aggregates( - mut self, - value: Vec, - ) -> Self { - self.aggregates = Some(value); - self - } - - pub fn pagination( - mut self, - value: crate::datadogV1::model::UsageAttributionPagination, - ) -> Self { - self.pagination = Some(value); - self - } -} - -impl Default for UsageAttributionMetadata { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for UsageAttributionMetadata { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct UsageAttributionMetadataVisitor; - impl<'a> Visitor<'a> for UsageAttributionMetadataVisitor { - type Value = UsageAttributionMetadata; - - 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 aggregates: Option< - Vec, - > = None; - let mut pagination: Option = - None; - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "aggregates" => { - if v.is_null() { - continue; - } - aggregates = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "pagination" => { - if v.is_null() { - continue; - } - pagination = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - &_ => {} - } - } - - let content = UsageAttributionMetadata { - aggregates, - pagination, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(UsageAttributionMetadataVisitor) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_pagination.rs b/src/datadogV1/model/model_usage_attribution_pagination.rs deleted file mode 100644 index 2dcabe858..000000000 --- a/src/datadogV1/model/model_usage_attribution_pagination.rs +++ /dev/null @@ -1,155 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// The metadata for the current pagination. -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct UsageAttributionPagination { - /// Maximum amount of records to be returned. - #[serde(rename = "limit")] - pub limit: Option, - /// Records to be skipped before beginning to return. - #[serde(rename = "offset")] - pub offset: Option, - /// Direction to sort by. - #[serde(rename = "sort_direction")] - pub sort_direction: Option, - /// Field to sort by. - #[serde(rename = "sort_name")] - pub sort_name: Option, - /// Total number of records. - #[serde(rename = "total_number_of_records")] - pub total_number_of_records: Option, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl UsageAttributionPagination { - pub fn new() -> UsageAttributionPagination { - UsageAttributionPagination { - limit: None, - offset: None, - sort_direction: None, - sort_name: None, - total_number_of_records: None, - _unparsed: false, - } - } - - pub fn limit(mut self, value: i64) -> Self { - self.limit = Some(value); - self - } - - pub fn offset(mut self, value: i64) -> Self { - self.offset = Some(value); - self - } - - pub fn sort_direction(mut self, value: String) -> Self { - self.sort_direction = Some(value); - self - } - - pub fn sort_name(mut self, value: String) -> Self { - self.sort_name = Some(value); - self - } - - pub fn total_number_of_records(mut self, value: i64) -> Self { - self.total_number_of_records = Some(value); - self - } -} - -impl Default for UsageAttributionPagination { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for UsageAttributionPagination { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct UsageAttributionPaginationVisitor; - impl<'a> Visitor<'a> for UsageAttributionPaginationVisitor { - type Value = UsageAttributionPagination; - - 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 limit: Option = None; - let mut offset: Option = None; - let mut sort_direction: Option = None; - let mut sort_name: Option = None; - let mut total_number_of_records: Option = None; - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "limit" => { - if v.is_null() { - continue; - } - limit = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "offset" => { - if v.is_null() { - continue; - } - offset = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "sort_direction" => { - if v.is_null() { - continue; - } - sort_direction = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "sort_name" => { - if v.is_null() { - continue; - } - sort_name = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "total_number_of_records" => { - if v.is_null() { - continue; - } - total_number_of_records = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - &_ => {} - } - } - - let content = UsageAttributionPagination { - limit, - offset, - sort_direction, - sort_name, - total_number_of_records, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(UsageAttributionPaginationVisitor) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_response.rs b/src/datadogV1/model/model_usage_attribution_response.rs deleted file mode 100644 index 27409ac32..000000000 --- a/src/datadogV1/model/model_usage_attribution_response.rs +++ /dev/null @@ -1,102 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Response containing the Usage Summary by tag(s). -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct UsageAttributionResponse { - /// The object containing document metadata. - #[serde(rename = "metadata")] - pub metadata: Option, - /// Get usage summary by tag(s). - #[serde(rename = "usage")] - pub usage: Option>, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl UsageAttributionResponse { - pub fn new() -> UsageAttributionResponse { - UsageAttributionResponse { - metadata: None, - usage: None, - _unparsed: false, - } - } - - pub fn metadata(mut self, value: crate::datadogV1::model::UsageAttributionMetadata) -> Self { - self.metadata = Some(value); - self - } - - pub fn usage(mut self, value: Vec) -> Self { - self.usage = Some(value); - self - } -} - -impl Default for UsageAttributionResponse { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for UsageAttributionResponse { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct UsageAttributionResponseVisitor; - impl<'a> Visitor<'a> for UsageAttributionResponseVisitor { - type Value = UsageAttributionResponse; - - 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 metadata: Option = None; - let mut usage: Option> = None; - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "metadata" => { - if v.is_null() { - continue; - } - metadata = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "usage" => { - if v.is_null() { - continue; - } - usage = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - &_ => {} - } - } - - let content = UsageAttributionResponse { - metadata, - usage, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(UsageAttributionResponseVisitor) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_sort.rs b/src/datadogV1/model/model_usage_attribution_sort.rs deleted file mode 100644 index 23c821676..000000000 --- a/src/datadogV1/model/model_usage_attribution_sort.rs +++ /dev/null @@ -1,181 +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 UsageAttributionSort { - API_PERCENTAGE, - SNMP_USAGE, - APM_HOST_USAGE, - API_USAGE, - APPSEC_USAGE, - APPSEC_PERCENTAGE, - CONTAINER_USAGE, - CUSTOM_TIMESERIES_PERCENTAGE, - CONTAINER_PERCENTAGE, - APM_HOST_PERCENTAGE, - NPM_HOST_PERCENTAGE, - BROWSER_PERCENTAGE, - BROWSER_USAGE, - INFRA_HOST_PERCENTAGE, - SNMP_PERCENTAGE, - NPM_HOST_USAGE, - INFRA_HOST_USAGE, - CUSTOM_TIMESERIES_USAGE, - LAMBDA_FUNCTIONS_USAGE, - LAMBDA_FUNCTIONS_PERCENTAGE, - LAMBDA_INVOCATIONS_USAGE, - LAMBDA_INVOCATIONS_PERCENTAGE, - ESTIMATED_INDEXED_LOGS_USAGE, - ESTIMATED_INDEXED_LOGS_PERCENTAGE, - ESTIMATED_INGESTED_LOGS_USAGE, - ESTIMATED_INGESTED_LOGS_PERCENTAGE, - ESTIMATED_INDEXED_SPANS_USAGE, - ESTIMATED_INDEXED_SPANS_PERCENTAGE, - ESTIMATED_INGESTED_SPANS_USAGE, - ESTIMATED_INGESTED_SPANS_PERCENTAGE, - APM_FARGATE_USAGE, - APM_FARGATE_PERCENTAGE, - APPSEC_FARGATE_USAGE, - APPSEC_FARGATE_PERCENTAGE, - ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE, - ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE, - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl ToString for UsageAttributionSort { - fn to_string(&self) -> String { - match self { - Self::API_PERCENTAGE => String::from("api_percentage"), - Self::SNMP_USAGE => String::from("snmp_usage"), - Self::APM_HOST_USAGE => String::from("apm_host_usage"), - Self::API_USAGE => String::from("api_usage"), - Self::APPSEC_USAGE => String::from("appsec_usage"), - Self::APPSEC_PERCENTAGE => String::from("appsec_percentage"), - Self::CONTAINER_USAGE => String::from("container_usage"), - Self::CUSTOM_TIMESERIES_PERCENTAGE => String::from("custom_timeseries_percentage"), - Self::CONTAINER_PERCENTAGE => String::from("container_percentage"), - Self::APM_HOST_PERCENTAGE => String::from("apm_host_percentage"), - Self::NPM_HOST_PERCENTAGE => String::from("npm_host_percentage"), - Self::BROWSER_PERCENTAGE => String::from("browser_percentage"), - Self::BROWSER_USAGE => String::from("browser_usage"), - Self::INFRA_HOST_PERCENTAGE => String::from("infra_host_percentage"), - Self::SNMP_PERCENTAGE => String::from("snmp_percentage"), - Self::NPM_HOST_USAGE => String::from("npm_host_usage"), - Self::INFRA_HOST_USAGE => String::from("infra_host_usage"), - Self::CUSTOM_TIMESERIES_USAGE => String::from("custom_timeseries_usage"), - Self::LAMBDA_FUNCTIONS_USAGE => String::from("lambda_functions_usage"), - Self::LAMBDA_FUNCTIONS_PERCENTAGE => String::from("lambda_functions_percentage"), - Self::LAMBDA_INVOCATIONS_USAGE => String::from("lambda_invocations_usage"), - Self::LAMBDA_INVOCATIONS_PERCENTAGE => String::from("lambda_invocations_percentage"), - Self::ESTIMATED_INDEXED_LOGS_USAGE => String::from("estimated_indexed_logs_usage"), - Self::ESTIMATED_INDEXED_LOGS_PERCENTAGE => { - String::from("estimated_indexed_logs_percentage") - } - Self::ESTIMATED_INGESTED_LOGS_USAGE => String::from("estimated_ingested_logs_usage"), - Self::ESTIMATED_INGESTED_LOGS_PERCENTAGE => { - String::from("estimated_ingested_logs_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::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::ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE => { - String::from("estimated_rum_usage_attribution_usage") - } - Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE => { - String::from("estimated_rum_usage_attribution_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::UnparsedObject(v) => v.value.to_string(), - } - } -} - -impl Serialize for UsageAttributionSort { - 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 UsageAttributionSort { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s: String = String::deserialize(deserializer)?; - Ok(match s.as_str() { - "api_percentage" => Self::API_PERCENTAGE, - "snmp_usage" => Self::SNMP_USAGE, - "apm_host_usage" => Self::APM_HOST_USAGE, - "api_usage" => Self::API_USAGE, - "appsec_usage" => Self::APPSEC_USAGE, - "appsec_percentage" => Self::APPSEC_PERCENTAGE, - "container_usage" => Self::CONTAINER_USAGE, - "custom_timeseries_percentage" => Self::CUSTOM_TIMESERIES_PERCENTAGE, - "container_percentage" => Self::CONTAINER_PERCENTAGE, - "apm_host_percentage" => Self::APM_HOST_PERCENTAGE, - "npm_host_percentage" => Self::NPM_HOST_PERCENTAGE, - "browser_percentage" => Self::BROWSER_PERCENTAGE, - "browser_usage" => Self::BROWSER_USAGE, - "infra_host_percentage" => Self::INFRA_HOST_PERCENTAGE, - "snmp_percentage" => Self::SNMP_PERCENTAGE, - "npm_host_usage" => Self::NPM_HOST_USAGE, - "infra_host_usage" => Self::INFRA_HOST_USAGE, - "custom_timeseries_usage" => Self::CUSTOM_TIMESERIES_USAGE, - "lambda_functions_usage" => Self::LAMBDA_FUNCTIONS_USAGE, - "lambda_functions_percentage" => Self::LAMBDA_FUNCTIONS_PERCENTAGE, - "lambda_invocations_usage" => Self::LAMBDA_INVOCATIONS_USAGE, - "lambda_invocations_percentage" => Self::LAMBDA_INVOCATIONS_PERCENTAGE, - "estimated_indexed_logs_usage" => Self::ESTIMATED_INDEXED_LOGS_USAGE, - "estimated_indexed_logs_percentage" => Self::ESTIMATED_INDEXED_LOGS_PERCENTAGE, - "estimated_ingested_logs_usage" => Self::ESTIMATED_INGESTED_LOGS_USAGE, - "estimated_ingested_logs_percentage" => Self::ESTIMATED_INGESTED_LOGS_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, - "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, - "estimated_rum_usage_attribution_usage" => Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE, - "estimated_rum_usage_attribution_percentage" => { - Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE - } - "asm_serverless_traced_invocations_usage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - } - "asm_serverless_traced_invocations_percentage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - } - _ => Self::UnparsedObject(crate::datadog::UnparsedObject { - value: serde_json::Value::String(s.into()), - }), - }) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_supported_metrics.rs b/src/datadogV1/model/model_usage_attribution_supported_metrics.rs deleted file mode 100644 index 5b5acc09a..000000000 --- a/src/datadogV1/model/model_usage_attribution_supported_metrics.rs +++ /dev/null @@ -1,214 +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 UsageAttributionSupportedMetrics { - CUSTOM_TIMESERIES_USAGE, - CONTAINER_USAGE, - SNMP_PERCENTAGE, - APM_HOST_USAGE, - BROWSER_USAGE, - NPM_HOST_PERCENTAGE, - INFRA_HOST_USAGE, - CUSTOM_TIMESERIES_PERCENTAGE, - CONTAINER_PERCENTAGE, - API_USAGE, - APM_HOST_PERCENTAGE, - INFRA_HOST_PERCENTAGE, - SNMP_USAGE, - BROWSER_PERCENTAGE, - API_PERCENTAGE, - NPM_HOST_USAGE, - LAMBDA_FUNCTIONS_USAGE, - LAMBDA_FUNCTIONS_PERCENTAGE, - LAMBDA_INVOCATIONS_USAGE, - LAMBDA_INVOCATIONS_PERCENTAGE, - FARGATE_USAGE, - FARGATE_PERCENTAGE, - PROFILED_HOST_USAGE, - PROFILED_HOST_PERCENTAGE, - PROFILED_CONTAINER_USAGE, - PROFILED_CONTAINER_PERCENTAGE, - DBM_HOSTS_USAGE, - DBM_HOSTS_PERCENTAGE, - DBM_QUERIES_USAGE, - DBM_QUERIES_PERCENTAGE, - ESTIMATED_INDEXED_LOGS_USAGE, - ESTIMATED_INDEXED_LOGS_PERCENTAGE, - ESTIMATED_INGESTED_LOGS_USAGE, - ESTIMATED_INGESTED_LOGS_PERCENTAGE, - APPSEC_USAGE, - APPSEC_PERCENTAGE, - ESTIMATED_INDEXED_SPANS_USAGE, - ESTIMATED_INDEXED_SPANS_PERCENTAGE, - ESTIMATED_INGESTED_SPANS_USAGE, - ESTIMATED_INGESTED_SPANS_PERCENTAGE, - APM_FARGATE_USAGE, - APM_FARGATE_PERCENTAGE, - APPSEC_FARGATE_USAGE, - APPSEC_FARGATE_PERCENTAGE, - ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE, - ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE, - ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE, - ALL, - UnparsedObject(crate::datadog::UnparsedObject), -} - -impl ToString for UsageAttributionSupportedMetrics { - fn to_string(&self) -> String { - match self { - Self::CUSTOM_TIMESERIES_USAGE => String::from("custom_timeseries_usage"), - Self::CONTAINER_USAGE => String::from("container_usage"), - Self::SNMP_PERCENTAGE => String::from("snmp_percentage"), - Self::APM_HOST_USAGE => String::from("apm_host_usage"), - Self::BROWSER_USAGE => String::from("browser_usage"), - Self::NPM_HOST_PERCENTAGE => String::from("npm_host_percentage"), - Self::INFRA_HOST_USAGE => String::from("infra_host_usage"), - Self::CUSTOM_TIMESERIES_PERCENTAGE => String::from("custom_timeseries_percentage"), - Self::CONTAINER_PERCENTAGE => String::from("container_percentage"), - Self::API_USAGE => String::from("api_usage"), - Self::APM_HOST_PERCENTAGE => String::from("apm_host_percentage"), - Self::INFRA_HOST_PERCENTAGE => String::from("infra_host_percentage"), - Self::SNMP_USAGE => String::from("snmp_usage"), - Self::BROWSER_PERCENTAGE => String::from("browser_percentage"), - Self::API_PERCENTAGE => String::from("api_percentage"), - Self::NPM_HOST_USAGE => String::from("npm_host_usage"), - Self::LAMBDA_FUNCTIONS_USAGE => String::from("lambda_functions_usage"), - Self::LAMBDA_FUNCTIONS_PERCENTAGE => String::from("lambda_functions_percentage"), - Self::LAMBDA_INVOCATIONS_USAGE => String::from("lambda_invocations_usage"), - Self::LAMBDA_INVOCATIONS_PERCENTAGE => String::from("lambda_invocations_percentage"), - Self::FARGATE_USAGE => String::from("fargate_usage"), - Self::FARGATE_PERCENTAGE => String::from("fargate_percentage"), - Self::PROFILED_HOST_USAGE => String::from("profiled_host_usage"), - Self::PROFILED_HOST_PERCENTAGE => String::from("profiled_host_percentage"), - Self::PROFILED_CONTAINER_USAGE => String::from("profiled_container_usage"), - Self::PROFILED_CONTAINER_PERCENTAGE => String::from("profiled_container_percentage"), - Self::DBM_HOSTS_USAGE => String::from("dbm_hosts_usage"), - Self::DBM_HOSTS_PERCENTAGE => String::from("dbm_hosts_percentage"), - Self::DBM_QUERIES_USAGE => String::from("dbm_queries_usage"), - Self::DBM_QUERIES_PERCENTAGE => String::from("dbm_queries_percentage"), - Self::ESTIMATED_INDEXED_LOGS_USAGE => String::from("estimated_indexed_logs_usage"), - Self::ESTIMATED_INDEXED_LOGS_PERCENTAGE => { - String::from("estimated_indexed_logs_percentage") - } - Self::ESTIMATED_INGESTED_LOGS_USAGE => String::from("estimated_ingested_logs_usage"), - Self::ESTIMATED_INGESTED_LOGS_PERCENTAGE => { - String::from("estimated_ingested_logs_percentage") - } - Self::APPSEC_USAGE => String::from("appsec_usage"), - Self::APPSEC_PERCENTAGE => String::from("appsec_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::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::ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE => { - String::from("estimated_rum_usage_attribution_usage") - } - Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE => { - String::from("estimated_rum_usage_attribution_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::ALL => String::from("*"), - Self::UnparsedObject(v) => v.value.to_string(), - } - } -} - -impl Serialize for UsageAttributionSupportedMetrics { - 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 UsageAttributionSupportedMetrics { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s: String = String::deserialize(deserializer)?; - Ok(match s.as_str() { - "custom_timeseries_usage" => Self::CUSTOM_TIMESERIES_USAGE, - "container_usage" => Self::CONTAINER_USAGE, - "snmp_percentage" => Self::SNMP_PERCENTAGE, - "apm_host_usage" => Self::APM_HOST_USAGE, - "browser_usage" => Self::BROWSER_USAGE, - "npm_host_percentage" => Self::NPM_HOST_PERCENTAGE, - "infra_host_usage" => Self::INFRA_HOST_USAGE, - "custom_timeseries_percentage" => Self::CUSTOM_TIMESERIES_PERCENTAGE, - "container_percentage" => Self::CONTAINER_PERCENTAGE, - "api_usage" => Self::API_USAGE, - "apm_host_percentage" => Self::APM_HOST_PERCENTAGE, - "infra_host_percentage" => Self::INFRA_HOST_PERCENTAGE, - "snmp_usage" => Self::SNMP_USAGE, - "browser_percentage" => Self::BROWSER_PERCENTAGE, - "api_percentage" => Self::API_PERCENTAGE, - "npm_host_usage" => Self::NPM_HOST_USAGE, - "lambda_functions_usage" => Self::LAMBDA_FUNCTIONS_USAGE, - "lambda_functions_percentage" => Self::LAMBDA_FUNCTIONS_PERCENTAGE, - "lambda_invocations_usage" => Self::LAMBDA_INVOCATIONS_USAGE, - "lambda_invocations_percentage" => Self::LAMBDA_INVOCATIONS_PERCENTAGE, - "fargate_usage" => Self::FARGATE_USAGE, - "fargate_percentage" => Self::FARGATE_PERCENTAGE, - "profiled_host_usage" => Self::PROFILED_HOST_USAGE, - "profiled_host_percentage" => Self::PROFILED_HOST_PERCENTAGE, - "profiled_container_usage" => Self::PROFILED_CONTAINER_USAGE, - "profiled_container_percentage" => Self::PROFILED_CONTAINER_PERCENTAGE, - "dbm_hosts_usage" => Self::DBM_HOSTS_USAGE, - "dbm_hosts_percentage" => Self::DBM_HOSTS_PERCENTAGE, - "dbm_queries_usage" => Self::DBM_QUERIES_USAGE, - "dbm_queries_percentage" => Self::DBM_QUERIES_PERCENTAGE, - "estimated_indexed_logs_usage" => Self::ESTIMATED_INDEXED_LOGS_USAGE, - "estimated_indexed_logs_percentage" => Self::ESTIMATED_INDEXED_LOGS_PERCENTAGE, - "estimated_ingested_logs_usage" => Self::ESTIMATED_INGESTED_LOGS_USAGE, - "estimated_ingested_logs_percentage" => Self::ESTIMATED_INGESTED_LOGS_PERCENTAGE, - "appsec_usage" => Self::APPSEC_USAGE, - "appsec_percentage" => Self::APPSEC_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, - "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, - "estimated_rum_usage_attribution_usage" => Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_USAGE, - "estimated_rum_usage_attribution_percentage" => { - Self::ESTIMATED_RUM_USAGE_ATTRIBUTION_PERCENTAGE - } - "asm_serverless_traced_invocations_usage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_USAGE - } - "asm_serverless_traced_invocations_percentage" => { - Self::ASM_SERVERLESS_TRACED_INVOCATIONS_PERCENTAGE - } - "*" => Self::ALL, - _ => Self::UnparsedObject(crate::datadog::UnparsedObject { - value: serde_json::Value::String(s.into()), - }), - }) - } -} diff --git a/src/datadogV1/model/model_usage_attribution_values.rs b/src/datadogV1/model/model_usage_attribution_values.rs deleted file mode 100644 index 045340ff0..000000000 --- a/src/datadogV1/model/model_usage_attribution_values.rs +++ /dev/null @@ -1,1002 +0,0 @@ -// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. -// This product includes software developed at Datadog (https://www.datadoghq.com/). -// Copyright 2019-Present Datadog, Inc. -use serde::de::{Error, MapAccess, Visitor}; -use serde::{Deserialize, Deserializer, Serialize}; -use serde_with::skip_serializing_none; -use std::fmt::{self, Formatter}; - -/// Fields in Usage Summary by tag(s). -#[non_exhaustive] -#[skip_serializing_none] -#[derive(Clone, Debug, PartialEq, Serialize)] -pub struct UsageAttributionValues { - /// The percentage of synthetic API test usage by tag(s). - #[serde(rename = "api_percentage")] - pub api_percentage: Option, - /// The synthetic API test usage by tag(s). - #[serde(rename = "api_usage")] - pub api_usage: Option, - /// The percentage of APM ECS Fargate task usage by tag(s). - #[serde(rename = "apm_fargate_percentage")] - pub apm_fargate_percentage: Option, - /// The APM ECS Fargate task usage by tag(s). - #[serde(rename = "apm_fargate_usage")] - pub apm_fargate_usage: Option, - /// The percentage of APM host usage by tag(s). - #[serde(rename = "apm_host_percentage")] - pub apm_host_percentage: Option, - /// The APM host usage by tag(s). - #[serde(rename = "apm_host_usage")] - pub apm_host_usage: Option, - /// The percentage of Application Security Monitoring ECS Fargate task usage by tag(s). - #[serde(rename = "appsec_fargate_percentage")] - pub appsec_fargate_percentage: Option, - /// The Application Security Monitoring ECS Fargate task usage by tag(s). - #[serde(rename = "appsec_fargate_usage")] - pub appsec_fargate_usage: Option, - /// The percentage of Application Security Monitoring host usage by tag(s). - #[serde(rename = "appsec_percentage")] - pub appsec_percentage: Option, - /// The Application Security Monitoring host usage by tag(s). - #[serde(rename = "appsec_usage")] - pub appsec_usage: Option, - /// The percentage of synthetic browser test usage by tag(s). - #[serde(rename = "browser_percentage")] - pub browser_percentage: Option, - /// The synthetic browser test usage by tag(s). - #[serde(rename = "browser_usage")] - pub browser_usage: Option, - /// The percentage of container usage by tag(s). - #[serde(rename = "container_percentage")] - pub container_percentage: Option, - /// The container usage by tag(s). - #[serde(rename = "container_usage")] - pub container_usage: Option, - /// The percentage of Cloud Security Management Pro container usage by tag(s) - #[serde(rename = "cspm_container_percentage")] - pub cspm_container_percentage: Option, - /// The Cloud Security Management Pro container usage by tag(s) - #[serde(rename = "cspm_container_usage")] - pub cspm_container_usage: Option, - /// The percentage of Cloud Security Management Pro host usage by tag(s) - #[serde(rename = "cspm_host_percentage")] - pub cspm_host_percentage: Option, - /// The Cloud Security Management Pro host usage by tag(s) - #[serde(rename = "cspm_host_usage")] - pub cspm_host_usage: Option, - /// The percentage of custom metrics usage by tag(s). - #[serde(rename = "custom_timeseries_percentage")] - pub custom_timeseries_percentage: Option, - /// The custom metrics usage by tag(s). - #[serde(rename = "custom_timeseries_usage")] - pub custom_timeseries_usage: Option, - /// The percentage of Cloud Workload Security container usage by tag(s) - #[serde(rename = "cws_container_percentage")] - pub cws_container_percentage: Option, - /// The Cloud Workload Security container usage by tag(s) - #[serde(rename = "cws_container_usage")] - pub cws_container_usage: Option, - /// The percentage of Cloud Workload Security host usage by tag(s) - #[serde(rename = "cws_host_percentage")] - pub cws_host_percentage: Option, - /// The Cloud Workload Security host usage by tag(s) - #[serde(rename = "cws_host_usage")] - pub cws_host_usage: Option, - /// The percentage of Database Monitoring host usage by tag(s). - #[serde(rename = "dbm_hosts_percentage")] - pub dbm_hosts_percentage: Option, - /// The Database Monitoring host usage by tag(s). - #[serde(rename = "dbm_hosts_usage")] - pub dbm_hosts_usage: Option, - /// The percentage of Database Monitoring normalized queries usage by tag(s). - #[serde(rename = "dbm_queries_percentage")] - pub dbm_queries_percentage: Option, - /// The Database Monitoring normalized queries usage by tag(s). - #[serde(rename = "dbm_queries_usage")] - pub dbm_queries_usage: Option, - /// The percentage of estimated live indexed logs usage by tag(s). - #[serde(rename = "estimated_indexed_logs_percentage")] - pub estimated_indexed_logs_percentage: Option, - /// The estimated live indexed logs usage by tag(s). - #[serde(rename = "estimated_indexed_logs_usage")] - pub estimated_indexed_logs_usage: Option, - /// The percentage of estimated indexed spans usage by tag(s). - #[serde(rename = "estimated_indexed_spans_percentage")] - pub estimated_indexed_spans_percentage: Option, - /// The estimated indexed spans usage by tag(s). - #[serde(rename = "estimated_indexed_spans_usage")] - pub estimated_indexed_spans_usage: Option, - /// The percentage of estimated live ingested logs usage by tag(s). - #[serde(rename = "estimated_ingested_logs_percentage")] - pub estimated_ingested_logs_percentage: Option, - /// The estimated live ingested logs usage by tag(s). - #[serde(rename = "estimated_ingested_logs_usage")] - pub estimated_ingested_logs_usage: Option, - /// The percentage of estimated ingested spans usage by tag(s). - #[serde(rename = "estimated_ingested_spans_percentage")] - pub estimated_ingested_spans_percentage: Option, - /// The estimated ingested spans usage by tag(s). - #[serde(rename = "estimated_ingested_spans_usage")] - pub estimated_ingested_spans_usage: Option, - /// The percentage of estimated rum sessions usage by tag(s). - #[serde(rename = "estimated_rum_sessions_percentage")] - pub estimated_rum_sessions_percentage: Option, - /// The estimated rum sessions usage by tag(s). - #[serde(rename = "estimated_rum_sessions_usage")] - pub estimated_rum_sessions_usage: Option, - /// The percentage of infrastructure host usage by tag(s). - #[serde(rename = "infra_host_percentage")] - pub infra_host_percentage: Option, - /// The infrastructure host usage by tag(s). - #[serde(rename = "infra_host_usage")] - pub infra_host_usage: Option, - /// The percentage of Lambda function usage by tag(s). - #[serde(rename = "lambda_functions_percentage")] - pub lambda_functions_percentage: Option, - /// The Lambda function usage by tag(s). - #[serde(rename = "lambda_functions_usage")] - pub lambda_functions_usage: Option, - /// The percentage of Lambda invocation usage by tag(s). - #[serde(rename = "lambda_invocations_percentage")] - pub lambda_invocations_percentage: Option, - /// The Lambda invocation usage by tag(s). - #[serde(rename = "lambda_invocations_usage")] - pub lambda_invocations_usage: Option, - /// The percentage of network host usage by tag(s). - #[serde(rename = "npm_host_percentage")] - pub npm_host_percentage: Option, - /// The network host usage by tag(s). - #[serde(rename = "npm_host_usage")] - pub npm_host_usage: Option, - /// The percentage of profiled containers usage by tag(s). - #[serde(rename = "profiled_container_percentage")] - pub profiled_container_percentage: Option, - /// The profiled container usage by tag(s). - #[serde(rename = "profiled_container_usage")] - pub profiled_container_usage: Option, - /// The percentage of profiled hosts usage by tag(s). - #[serde(rename = "profiled_hosts_percentage")] - pub profiled_hosts_percentage: Option, - /// The profiled host usage by tag(s). - #[serde(rename = "profiled_hosts_usage")] - pub profiled_hosts_usage: Option, - /// The percentage of network device usage by tag(s). - #[serde(rename = "snmp_percentage")] - pub snmp_percentage: Option, - /// The network device usage by tag(s). - #[serde(rename = "snmp_usage")] - pub snmp_usage: Option, - #[serde(skip)] - #[serde(default)] - pub(crate) _unparsed: bool, -} - -impl UsageAttributionValues { - pub fn new() -> UsageAttributionValues { - UsageAttributionValues { - api_percentage: None, - api_usage: None, - apm_fargate_percentage: None, - apm_fargate_usage: None, - apm_host_percentage: None, - apm_host_usage: None, - appsec_fargate_percentage: None, - appsec_fargate_usage: None, - appsec_percentage: None, - appsec_usage: None, - browser_percentage: None, - browser_usage: None, - container_percentage: None, - container_usage: None, - cspm_container_percentage: None, - cspm_container_usage: None, - cspm_host_percentage: None, - cspm_host_usage: None, - custom_timeseries_percentage: None, - custom_timeseries_usage: None, - cws_container_percentage: None, - cws_container_usage: None, - cws_host_percentage: None, - cws_host_usage: None, - dbm_hosts_percentage: None, - dbm_hosts_usage: None, - dbm_queries_percentage: None, - dbm_queries_usage: None, - estimated_indexed_logs_percentage: None, - estimated_indexed_logs_usage: None, - estimated_indexed_spans_percentage: None, - estimated_indexed_spans_usage: None, - estimated_ingested_logs_percentage: None, - estimated_ingested_logs_usage: None, - estimated_ingested_spans_percentage: None, - estimated_ingested_spans_usage: None, - estimated_rum_sessions_percentage: None, - estimated_rum_sessions_usage: None, - infra_host_percentage: None, - infra_host_usage: None, - lambda_functions_percentage: None, - lambda_functions_usage: None, - lambda_invocations_percentage: None, - lambda_invocations_usage: None, - npm_host_percentage: None, - npm_host_usage: None, - profiled_container_percentage: None, - profiled_container_usage: None, - profiled_hosts_percentage: None, - profiled_hosts_usage: None, - snmp_percentage: None, - snmp_usage: None, - _unparsed: false, - } - } - - pub fn api_percentage(mut self, value: f64) -> Self { - self.api_percentage = Some(value); - self - } - - pub fn api_usage(mut self, value: f64) -> Self { - self.api_usage = Some(value); - self - } - - pub fn apm_fargate_percentage(mut self, value: f64) -> Self { - self.apm_fargate_percentage = Some(value); - self - } - - pub fn apm_fargate_usage(mut self, value: f64) -> Self { - self.apm_fargate_usage = Some(value); - self - } - - pub fn apm_host_percentage(mut self, value: f64) -> Self { - self.apm_host_percentage = Some(value); - self - } - - pub fn apm_host_usage(mut self, value: f64) -> Self { - self.apm_host_usage = Some(value); - self - } - - pub fn appsec_fargate_percentage(mut self, value: f64) -> Self { - self.appsec_fargate_percentage = Some(value); - self - } - - pub fn appsec_fargate_usage(mut self, value: f64) -> Self { - self.appsec_fargate_usage = Some(value); - self - } - - pub fn appsec_percentage(mut self, value: f64) -> Self { - self.appsec_percentage = Some(value); - self - } - - pub fn appsec_usage(mut self, value: f64) -> Self { - self.appsec_usage = Some(value); - self - } - - pub fn browser_percentage(mut self, value: f64) -> Self { - self.browser_percentage = Some(value); - self - } - - pub fn browser_usage(mut self, value: f64) -> Self { - self.browser_usage = Some(value); - self - } - - pub fn container_percentage(mut self, value: f64) -> Self { - self.container_percentage = Some(value); - self - } - - pub fn container_usage(mut self, value: f64) -> Self { - self.container_usage = Some(value); - self - } - - pub fn cspm_container_percentage(mut self, value: f64) -> Self { - self.cspm_container_percentage = Some(value); - self - } - - pub fn cspm_container_usage(mut self, value: f64) -> Self { - self.cspm_container_usage = Some(value); - self - } - - pub fn cspm_host_percentage(mut self, value: f64) -> Self { - self.cspm_host_percentage = Some(value); - self - } - - pub fn cspm_host_usage(mut self, value: f64) -> Self { - self.cspm_host_usage = Some(value); - self - } - - pub fn custom_timeseries_percentage(mut self, value: f64) -> Self { - self.custom_timeseries_percentage = Some(value); - self - } - - pub fn custom_timeseries_usage(mut self, value: f64) -> Self { - self.custom_timeseries_usage = Some(value); - self - } - - pub fn cws_container_percentage(mut self, value: f64) -> Self { - self.cws_container_percentage = Some(value); - self - } - - pub fn cws_container_usage(mut self, value: f64) -> Self { - self.cws_container_usage = Some(value); - self - } - - pub fn cws_host_percentage(mut self, value: f64) -> Self { - self.cws_host_percentage = Some(value); - self - } - - pub fn cws_host_usage(mut self, value: f64) -> Self { - self.cws_host_usage = Some(value); - self - } - - pub fn dbm_hosts_percentage(mut self, value: f64) -> Self { - self.dbm_hosts_percentage = Some(value); - self - } - - pub fn dbm_hosts_usage(mut self, value: f64) -> Self { - self.dbm_hosts_usage = Some(value); - self - } - - pub fn dbm_queries_percentage(mut self, value: f64) -> Self { - self.dbm_queries_percentage = Some(value); - self - } - - pub fn dbm_queries_usage(mut self, value: f64) -> Self { - self.dbm_queries_usage = Some(value); - self - } - - pub fn estimated_indexed_logs_percentage(mut self, value: f64) -> Self { - self.estimated_indexed_logs_percentage = Some(value); - self - } - - pub fn estimated_indexed_logs_usage(mut self, value: f64) -> Self { - self.estimated_indexed_logs_usage = Some(value); - self - } - - pub fn estimated_indexed_spans_percentage(mut self, value: f64) -> Self { - self.estimated_indexed_spans_percentage = Some(value); - self - } - - pub fn estimated_indexed_spans_usage(mut self, value: f64) -> Self { - self.estimated_indexed_spans_usage = Some(value); - self - } - - pub fn estimated_ingested_logs_percentage(mut self, value: f64) -> Self { - self.estimated_ingested_logs_percentage = Some(value); - self - } - - pub fn estimated_ingested_logs_usage(mut self, value: f64) -> Self { - self.estimated_ingested_logs_usage = Some(value); - self - } - - pub fn estimated_ingested_spans_percentage(mut self, value: f64) -> Self { - self.estimated_ingested_spans_percentage = Some(value); - self - } - - pub fn estimated_ingested_spans_usage(mut self, value: f64) -> Self { - self.estimated_ingested_spans_usage = Some(value); - self - } - - pub fn estimated_rum_sessions_percentage(mut self, value: f64) -> Self { - self.estimated_rum_sessions_percentage = Some(value); - self - } - - pub fn estimated_rum_sessions_usage(mut self, value: f64) -> Self { - self.estimated_rum_sessions_usage = Some(value); - self - } - - pub fn infra_host_percentage(mut self, value: f64) -> Self { - self.infra_host_percentage = Some(value); - self - } - - pub fn infra_host_usage(mut self, value: f64) -> Self { - self.infra_host_usage = Some(value); - self - } - - pub fn lambda_functions_percentage(mut self, value: f64) -> Self { - self.lambda_functions_percentage = Some(value); - self - } - - pub fn lambda_functions_usage(mut self, value: f64) -> Self { - self.lambda_functions_usage = Some(value); - self - } - - pub fn lambda_invocations_percentage(mut self, value: f64) -> Self { - self.lambda_invocations_percentage = Some(value); - self - } - - pub fn lambda_invocations_usage(mut self, value: f64) -> Self { - self.lambda_invocations_usage = Some(value); - self - } - - pub fn npm_host_percentage(mut self, value: f64) -> Self { - self.npm_host_percentage = Some(value); - self - } - - pub fn npm_host_usage(mut self, value: f64) -> Self { - self.npm_host_usage = Some(value); - self - } - - pub fn profiled_container_percentage(mut self, value: f64) -> Self { - self.profiled_container_percentage = Some(value); - self - } - - pub fn profiled_container_usage(mut self, value: f64) -> Self { - self.profiled_container_usage = Some(value); - self - } - - pub fn profiled_hosts_percentage(mut self, value: f64) -> Self { - self.profiled_hosts_percentage = Some(value); - self - } - - pub fn profiled_hosts_usage(mut self, value: f64) -> Self { - self.profiled_hosts_usage = Some(value); - self - } - - pub fn snmp_percentage(mut self, value: f64) -> Self { - self.snmp_percentage = Some(value); - self - } - - pub fn snmp_usage(mut self, value: f64) -> Self { - self.snmp_usage = Some(value); - self - } -} - -impl Default for UsageAttributionValues { - fn default() -> Self { - Self::new() - } -} - -impl<'de> Deserialize<'de> for UsageAttributionValues { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - struct UsageAttributionValuesVisitor; - impl<'a> Visitor<'a> for UsageAttributionValuesVisitor { - type Value = UsageAttributionValues; - - 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 api_percentage: Option = None; - let mut api_usage: Option = None; - let mut apm_fargate_percentage: Option = None; - let mut apm_fargate_usage: Option = None; - let mut apm_host_percentage: Option = None; - let mut apm_host_usage: Option = None; - let mut appsec_fargate_percentage: Option = None; - let mut appsec_fargate_usage: Option = None; - let mut appsec_percentage: Option = None; - let mut appsec_usage: Option = None; - let mut browser_percentage: Option = None; - let mut browser_usage: Option = None; - let mut container_percentage: Option = None; - let mut container_usage: Option = None; - let mut cspm_container_percentage: Option = None; - let mut cspm_container_usage: Option = None; - let mut cspm_host_percentage: Option = None; - let mut cspm_host_usage: Option = None; - let mut custom_timeseries_percentage: Option = None; - let mut custom_timeseries_usage: Option = None; - let mut cws_container_percentage: Option = None; - let mut cws_container_usage: Option = None; - let mut cws_host_percentage: Option = None; - let mut cws_host_usage: Option = None; - let mut dbm_hosts_percentage: Option = None; - let mut dbm_hosts_usage: Option = None; - let mut dbm_queries_percentage: Option = None; - let mut dbm_queries_usage: Option = None; - let mut estimated_indexed_logs_percentage: Option = None; - let mut estimated_indexed_logs_usage: Option = None; - let mut estimated_indexed_spans_percentage: Option = None; - let mut estimated_indexed_spans_usage: Option = None; - let mut estimated_ingested_logs_percentage: Option = None; - let mut estimated_ingested_logs_usage: Option = None; - let mut estimated_ingested_spans_percentage: Option = None; - let mut estimated_ingested_spans_usage: Option = None; - let mut estimated_rum_sessions_percentage: Option = None; - let mut estimated_rum_sessions_usage: Option = None; - let mut infra_host_percentage: Option = None; - let mut infra_host_usage: Option = None; - let mut lambda_functions_percentage: Option = None; - let mut lambda_functions_usage: Option = None; - let mut lambda_invocations_percentage: Option = None; - let mut lambda_invocations_usage: Option = None; - let mut npm_host_percentage: Option = None; - let mut npm_host_usage: Option = None; - let mut profiled_container_percentage: Option = None; - let mut profiled_container_usage: Option = None; - let mut profiled_hosts_percentage: Option = None; - let mut profiled_hosts_usage: Option = None; - let mut snmp_percentage: Option = None; - let mut snmp_usage: Option = None; - let mut _unparsed = false; - - while let Some((k, v)) = map.next_entry::()? { - match k.as_str() { - "api_percentage" => { - if v.is_null() { - continue; - } - api_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "api_usage" => { - if v.is_null() { - continue; - } - api_usage = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "apm_fargate_percentage" => { - if v.is_null() { - continue; - } - apm_fargate_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "apm_fargate_usage" => { - if v.is_null() { - continue; - } - apm_fargate_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "apm_host_percentage" => { - if v.is_null() { - continue; - } - apm_host_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "apm_host_usage" => { - if v.is_null() { - continue; - } - apm_host_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "appsec_fargate_percentage" => { - if v.is_null() { - continue; - } - appsec_fargate_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "appsec_fargate_usage" => { - if v.is_null() { - continue; - } - appsec_fargate_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "appsec_percentage" => { - if v.is_null() { - continue; - } - appsec_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "appsec_usage" => { - if v.is_null() { - continue; - } - appsec_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "browser_percentage" => { - if v.is_null() { - continue; - } - browser_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "browser_usage" => { - if v.is_null() { - continue; - } - browser_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "container_percentage" => { - if v.is_null() { - continue; - } - container_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "container_usage" => { - if v.is_null() { - continue; - } - container_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cspm_container_percentage" => { - if v.is_null() { - continue; - } - cspm_container_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cspm_container_usage" => { - if v.is_null() { - continue; - } - cspm_container_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cspm_host_percentage" => { - if v.is_null() { - continue; - } - cspm_host_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cspm_host_usage" => { - if v.is_null() { - continue; - } - cspm_host_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "custom_timeseries_percentage" => { - if v.is_null() { - continue; - } - custom_timeseries_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "custom_timeseries_usage" => { - if v.is_null() { - continue; - } - custom_timeseries_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cws_container_percentage" => { - if v.is_null() { - continue; - } - cws_container_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cws_container_usage" => { - if v.is_null() { - continue; - } - cws_container_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cws_host_percentage" => { - if v.is_null() { - continue; - } - cws_host_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "cws_host_usage" => { - if v.is_null() { - continue; - } - cws_host_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "dbm_hosts_percentage" => { - if v.is_null() { - continue; - } - dbm_hosts_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "dbm_hosts_usage" => { - if v.is_null() { - continue; - } - dbm_hosts_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "dbm_queries_percentage" => { - if v.is_null() { - continue; - } - dbm_queries_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "dbm_queries_usage" => { - if v.is_null() { - continue; - } - dbm_queries_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_indexed_logs_percentage" => { - if v.is_null() { - continue; - } - estimated_indexed_logs_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_indexed_logs_usage" => { - if v.is_null() { - continue; - } - estimated_indexed_logs_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_indexed_spans_percentage" => { - if v.is_null() { - continue; - } - estimated_indexed_spans_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_indexed_spans_usage" => { - if v.is_null() { - continue; - } - estimated_indexed_spans_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_ingested_logs_percentage" => { - if v.is_null() { - continue; - } - estimated_ingested_logs_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_ingested_logs_usage" => { - if v.is_null() { - continue; - } - estimated_ingested_logs_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_ingested_spans_percentage" => { - if v.is_null() { - continue; - } - estimated_ingested_spans_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_ingested_spans_usage" => { - if v.is_null() { - continue; - } - estimated_ingested_spans_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_rum_sessions_percentage" => { - if v.is_null() { - continue; - } - estimated_rum_sessions_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "estimated_rum_sessions_usage" => { - if v.is_null() { - continue; - } - estimated_rum_sessions_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "infra_host_percentage" => { - if v.is_null() { - continue; - } - infra_host_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "infra_host_usage" => { - if v.is_null() { - continue; - } - infra_host_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "lambda_functions_percentage" => { - if v.is_null() { - continue; - } - lambda_functions_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "lambda_functions_usage" => { - if v.is_null() { - continue; - } - lambda_functions_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "lambda_invocations_percentage" => { - if v.is_null() { - continue; - } - lambda_invocations_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "lambda_invocations_usage" => { - if v.is_null() { - continue; - } - lambda_invocations_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "npm_host_percentage" => { - if v.is_null() { - continue; - } - npm_host_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "npm_host_usage" => { - if v.is_null() { - continue; - } - npm_host_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "profiled_container_percentage" => { - if v.is_null() { - continue; - } - profiled_container_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "profiled_container_usage" => { - if v.is_null() { - continue; - } - profiled_container_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "profiled_hosts_percentage" => { - if v.is_null() { - continue; - } - profiled_hosts_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "profiled_hosts_usage" => { - if v.is_null() { - continue; - } - profiled_hosts_usage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "snmp_percentage" => { - if v.is_null() { - continue; - } - snmp_percentage = - Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - "snmp_usage" => { - if v.is_null() { - continue; - } - snmp_usage = Some(serde_json::from_value(v).map_err(M::Error::custom)?); - } - &_ => {} - } - } - - let content = UsageAttributionValues { - api_percentage, - api_usage, - apm_fargate_percentage, - apm_fargate_usage, - apm_host_percentage, - apm_host_usage, - appsec_fargate_percentage, - appsec_fargate_usage, - appsec_percentage, - appsec_usage, - browser_percentage, - browser_usage, - container_percentage, - container_usage, - cspm_container_percentage, - cspm_container_usage, - cspm_host_percentage, - cspm_host_usage, - custom_timeseries_percentage, - custom_timeseries_usage, - cws_container_percentage, - cws_container_usage, - cws_host_percentage, - cws_host_usage, - dbm_hosts_percentage, - dbm_hosts_usage, - dbm_queries_percentage, - dbm_queries_usage, - estimated_indexed_logs_percentage, - estimated_indexed_logs_usage, - estimated_indexed_spans_percentage, - estimated_indexed_spans_usage, - estimated_ingested_logs_percentage, - estimated_ingested_logs_usage, - estimated_ingested_spans_percentage, - estimated_ingested_spans_usage, - estimated_rum_sessions_percentage, - estimated_rum_sessions_usage, - infra_host_percentage, - infra_host_usage, - lambda_functions_percentage, - lambda_functions_usage, - lambda_invocations_percentage, - lambda_invocations_usage, - npm_host_percentage, - npm_host_usage, - profiled_container_percentage, - profiled_container_usage, - profiled_hosts_percentage, - profiled_hosts_usage, - snmp_percentage, - snmp_usage, - _unparsed, - }; - - Ok(content) - } - } - - deserializer.deserialize_any(UsageAttributionValuesVisitor) - } -} diff --git a/tests/scenarios/features/v1/undo.json b/tests/scenarios/features/v1/undo.json index c8a2684fb..16982e7aa 100644 --- a/tests/scenarios/features/v1/undo.json +++ b/tests/scenarios/features/v1/undo.json @@ -1322,12 +1322,6 @@ "type": "safe" } }, - "GetUsageAttribution": { - "tag": "Usage Metering", - "undo": { - "type": "safe" - } - }, "GetUsageAuditLogs": { "tag": "Usage Metering", "undo": { diff --git a/tests/scenarios/features/v1/usage_metering.feature b/tests/scenarios/features/v1/usage_metering.feature index 391d674cb..324dbe5e3 100644 --- a/tests/scenarios/features/v1/usage_metering.feature +++ b/tests/scenarios/features/v1/usage_metering.feature @@ -701,16 +701,6 @@ Feature: Usage Metering When the request is sent Then the response status is 200 OK - @skip @team:DataDog/red-zone-revenue-query - Scenario: Get usage attribution returns "OK" response - Given new "GetUsageAttribution" request - And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}" - And request contains "fields" parameter with value "*" - And request contains "offset" parameter with value 0 - And request contains "limit" parameter with value 1 - When the request is sent - Then the response status is 200 OK - @skip @team:DataDog/red-zone-revenue-query Scenario: Paginate monthly usage attribution Given there is a valid "monthly_usage_attribution" response diff --git a/tests/scenarios/function_mappings.rs b/tests/scenarios/function_mappings.rs index 42974e053..a5f22b773 100644 --- a/tests/scenarios/function_mappings.rs +++ b/tests/scenarios/function_mappings.rs @@ -723,10 +723,6 @@ pub fn collect_function_calls(world: &mut DatadogWorld) { "v1.GetUsageAnalyzedLogs".into(), test_v1_get_usage_analyzed_logs, ); - world.function_mappings.insert( - "v1.GetUsageAttribution".into(), - test_v1_get_usage_attribution, - ); world .function_mappings .insert("v1.GetUsageAuditLogs".into(), test_v1_get_usage_audit_logs); @@ -3258,60 +3254,6 @@ fn test_v1_get_usage_analyzed_logs(world: &mut DatadogWorld, _parameters: &HashM world.response.code = response.status.as_u16(); } -fn test_v1_get_usage_attribution(world: &mut DatadogWorld, _parameters: &HashMap) { - let api = world - .api_instances - .v1_api_usage_metering - .as_ref() - .expect("api instance not found"); - let start_month = - serde_json::from_value(_parameters.get("start_month").unwrap().clone()).unwrap(); - let fields = serde_json::from_value(_parameters.get("fields").unwrap().clone()).unwrap(); - let end_month = _parameters - .get("end_month") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let sort_direction = _parameters - .get("sort_direction") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let sort_name = _parameters - .get("sort_name") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let include_descendants = _parameters - .get("include_descendants") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let offset = _parameters - .get("offset") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let limit = _parameters - .get("limit") - .and_then(|param| Some(serde_json::from_value(param.clone()).unwrap())); - let mut params = - datadogV1::api::api_usage_metering::GetUsageAttributionOptionalParams::default(); - params.end_month = end_month; - params.sort_direction = sort_direction; - params.sort_name = sort_name; - params.include_descendants = include_descendants; - params.offset = offset; - params.limit = limit; - let response = - match block_on(api.get_usage_attribution_with_http_info(start_month, fields, params)) { - Ok(response) => response, - Err(error) => { - return match error { - Error::ResponseError(e) => { - world.response.code = e.status.as_u16(); - if let Some(entity) = e.entity { - world.response.object = serde_json::to_value(entity).unwrap(); - } - } - _ => panic!("error parsing response: {error}"), - }; - } - }; - world.response.object = serde_json::to_value(response.entity).unwrap(); - world.response.code = response.status.as_u16(); -} - fn test_v1_get_usage_audit_logs(world: &mut DatadogWorld, _parameters: &HashMap) { let api = world .api_instances