diff --git a/.apigentools-info b/.apigentools-info index 6a712028e88..6696766e35b 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.2.0", - "regenerated": "2020-07-01 12:47:47.512190", - "spec_repo_commit": "d472ef7" + "regenerated": "2020-07-02 22:52:46.497889", + "spec_repo_commit": "4d84e86" }, "v2": { "apigentools_version": "1.2.0", - "regenerated": "2020-07-01 12:47:52.405194", - "spec_repo_commit": "d472ef7" + "regenerated": "2020-07-02 22:52:51.322419", + "spec_repo_commit": "4d84e86" } } } \ No newline at end of file diff --git a/api/v1/datadog/.openapi-generator/FILES b/api/v1/datadog/.openapi-generator/FILES index cc669d566a0..a94a7a72730 100644 --- a/api/v1/datadog/.openapi-generator/FILES +++ b/api/v1/datadog/.openapi-generator/FILES @@ -348,6 +348,10 @@ docs/ToplistWidgetDefinitionType.md docs/ToplistWidgetRequest.md docs/UsageAnalyzedLogsHour.md docs/UsageAnalyzedLogsResponse.md +docs/UsageBillableSummaryBody.md +docs/UsageBillableSummaryHour.md +docs/UsageBillableSummaryKeys.md +docs/UsageBillableSummaryResponse.md docs/UsageFargateHour.md docs/UsageFargateResponse.md docs/UsageHostHour.md @@ -727,6 +731,10 @@ model_toplist_widget_definition_type.go model_toplist_widget_request.go model_usage_analyzed_logs_hour.go model_usage_analyzed_logs_response.go +model_usage_billable_summary_body.go +model_usage_billable_summary_hour.go +model_usage_billable_summary_keys.go +model_usage_billable_summary_response.go model_usage_fargate_hour.go model_usage_fargate_response.go model_usage_host_hour.go diff --git a/api/v1/datadog/README.md b/api/v1/datadog/README.md index a59c89466cc..d236ed35bd3 100644 --- a/api/v1/datadog/README.md +++ b/api/v1/datadog/README.md @@ -190,6 +190,7 @@ Class | Method | HTTP request | Description *TagsApi* | [**ListHostTags**](docs/TagsApi.md#listhosttags) | **Get** /api/v1/tags/hosts | Get Tags *TagsApi* | [**UpdateHostTags**](docs/TagsApi.md#updatehosttags) | **Put** /api/v1/tags/hosts/{host_name} | Update host tags *UsageMeteringApi* | [**GetUsageAnalyzedLogs**](docs/UsageMeteringApi.md#getusageanalyzedlogs) | **Get** /api/v1/usage/analyzed_logs | Get hourly usage for analyzed logs +*UsageMeteringApi* | [**GetUsageBillableSummary**](docs/UsageMeteringApi.md#getusagebillablesummary) | **Get** /api/v1/usage/billable-summary | Get monthly billable summary *UsageMeteringApi* | [**GetUsageFargate**](docs/UsageMeteringApi.md#getusagefargate) | **Get** /api/v1/usage/fargate | Get hourly usage for Fargate *UsageMeteringApi* | [**GetUsageHosts**](docs/UsageMeteringApi.md#getusagehosts) | **Get** /api/v1/usage/hosts | Get hourly usage for hosts and containers *UsageMeteringApi* | [**GetUsageLambda**](docs/UsageMeteringApi.md#getusagelambda) | **Get** /api/v1/usage/aws_lambda | Get hourly usage for Lambda @@ -510,6 +511,10 @@ Class | Method | HTTP request | Description - [ToplistWidgetRequest](docs/ToplistWidgetRequest.md) - [UsageAnalyzedLogsHour](docs/UsageAnalyzedLogsHour.md) - [UsageAnalyzedLogsResponse](docs/UsageAnalyzedLogsResponse.md) + - [UsageBillableSummaryBody](docs/UsageBillableSummaryBody.md) + - [UsageBillableSummaryHour](docs/UsageBillableSummaryHour.md) + - [UsageBillableSummaryKeys](docs/UsageBillableSummaryKeys.md) + - [UsageBillableSummaryResponse](docs/UsageBillableSummaryResponse.md) - [UsageFargateHour](docs/UsageFargateHour.md) - [UsageFargateResponse](docs/UsageFargateResponse.md) - [UsageHostHour](docs/UsageHostHour.md) diff --git a/api/v1/datadog/api/openapi.yaml b/api/v1/datadog/api/openapi.yaml index 5d96b7b9237..620fa15424b 100644 --- a/api/v1/datadog/api/openapi.yaml +++ b/api/v1/datadog/api/openapi.yaml @@ -5149,6 +5149,43 @@ paths: summary: Get hourly usage for Lambda tags: - Usage Metering + /api/v1/usage/billable-summary: + get: + description: Get the monthly billable summary. + operationId: GetUsageBillableSummary + parameters: + - description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` + for usage starting this month.' + explode: true + in: query + name: month + required: false + schema: + format: date-time + type: string + style: form + responses: + "200": + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/UsageBillableSummaryResponse' + description: OK + "400": + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json;datetime-format=rfc3339: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Get monthly billable summary + tags: + - Usage Metering /api/v1/usage/fargate: get: description: Get hourly usage for [Fargate](https://docs.datadoghq.com/integrations/ecs_fargate/). @@ -14142,6 +14179,729 @@ components: $ref: '#/components/schemas/UsageAnalyzedLogsHour' type: array type: object + UsageBillableSummaryBody: + description: Response with properties for each aggregated usage type. + example: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + properties: + account_billable_usage: + description: The total account usage. + format: int64 + type: integer + elapsed_usage_hours: + description: Elapsed usage hours for some billable product. + format: int64 + type: integer + first_billable_usage_hour: + description: The first billable hour for the org. + format: date-time + type: string + last_billable_usage_hour: + description: The last billable hour for the org. + format: date-time + type: string + org_billable_usage: + description: The number of units used within the billable timeframe. + format: int64 + type: integer + percentage_in_account: + description: The percentage of account usage the org represents. + format: double + type: number + usage_unit: + description: Units pertaining to the usage. + type: string + type: object + UsageBillableSummaryHour: + description: Response with monthly summary of data billed by Datadog. + example: + end_date: 2000-01-23T04:56:07.000+00:00 + num_orgs: 0 + ratio_in_month: 6 + usage: + npm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_api_tests_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + npm_flow_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_trace_search_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + iot_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_browser_checks_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + rum_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + lambda_function_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + siem_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + timeseries_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_container_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_ingested_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + fargate_container_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_indexed_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + billing_plan: billing_plan + org_name: org_name + public_id: public_id + start_date: 2000-01-23T04:56:07.000+00:00 + properties: + billing_plan: + description: The billing plan. + type: string + end_date: + description: Shows the last date of usage. + format: date-time + type: string + num_orgs: + description: The number of organizations. + format: int64 + type: integer + org_name: + description: The organization name. + type: string + public_id: + description: The organization public ID. + type: string + ratio_in_month: + description: Shows usage aggregation for a billing period. + format: int64 + type: integer + start_date: + description: Shows the first date of usage. + format: date-time + type: string + usage: + $ref: '#/components/schemas/UsageBillableSummaryKeys' + type: object + UsageBillableSummaryKeys: + description: Response with aggregated usage types. + example: + npm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_api_tests_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + npm_flow_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_trace_search_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + iot_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_browser_checks_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + rum_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + lambda_function_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + siem_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + timeseries_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_container_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_ingested_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + fargate_container_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_indexed_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + properties: + apm_host_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + apm_host_top99p: + $ref: '#/components/schemas/UsageBillableSummaryBody' + apm_trace_search_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + fargate_container_average: + $ref: '#/components/schemas/UsageBillableSummaryBody' + infra_container_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + infra_host_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + infra_host_top99p: + $ref: '#/components/schemas/UsageBillableSummaryBody' + iot_top99p: + $ref: '#/components/schemas/UsageBillableSummaryBody' + lambda_function_average: + $ref: '#/components/schemas/UsageBillableSummaryBody' + logs_indexed_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + logs_ingested_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + npm_flow_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + npm_host_top99p: + $ref: '#/components/schemas/UsageBillableSummaryBody' + rum_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + siem_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + synthetics_api_tests_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + synthetics_browser_checks_sum: + $ref: '#/components/schemas/UsageBillableSummaryBody' + timeseries_average: + $ref: '#/components/schemas/UsageBillableSummaryBody' + type: object + UsageBillableSummaryResponse: + description: Response with monthly summary of data billed by Datadog. + example: + usage: + - end_date: 2000-01-23T04:56:07.000+00:00 + num_orgs: 0 + ratio_in_month: 6 + usage: + npm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_api_tests_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + npm_flow_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_trace_search_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + iot_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_browser_checks_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + rum_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + lambda_function_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + siem_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + timeseries_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_container_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_ingested_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + fargate_container_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_indexed_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + billing_plan: billing_plan + org_name: org_name + public_id: public_id + start_date: 2000-01-23T04:56:07.000+00:00 + - end_date: 2000-01-23T04:56:07.000+00:00 + num_orgs: 0 + ratio_in_month: 6 + usage: + npm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_api_tests_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + npm_flow_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_trace_search_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + iot_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + synthetics_browser_checks_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + rum_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + lambda_function_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + siem_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + timeseries_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + apm_host_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_host_top99p: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + infra_container_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_ingested_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + fargate_container_average: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + logs_indexed_sum: + account_billable_usage: 1 + last_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + percentage_in_account: 2.3021358869347655 + elapsed_usage_hours: 5 + first_billable_usage_hour: 2000-01-23T04:56:07.000+00:00 + org_billable_usage: 5 + usage_unit: usage_unit + billing_plan: billing_plan + org_name: org_name + public_id: public_id + start_date: 2000-01-23T04:56:07.000+00:00 + properties: + usage: + description: An array of objects regarding usage of billable summary. + items: + $ref: '#/components/schemas/UsageBillableSummaryHour' + type: array + type: object UsageFargateHour: description: Number of Fargate tasks run and hourly usage. example: diff --git a/api/v1/datadog/api_usage_metering.go b/api/v1/datadog/api_usage_metering.go index 4dd92a044d6..339dcff430e 100644 --- a/api/v1/datadog/api_usage_metering.go +++ b/api/v1/datadog/api_usage_metering.go @@ -192,6 +192,162 @@ func (r apiGetUsageAnalyzedLogsRequest) Execute() (UsageAnalyzedLogsResponse, *_ return localVarReturnValue, localVarHTTPResponse, nil } +type apiGetUsageBillableSummaryRequest struct { + ctx _context.Context + apiService *UsageMeteringApiService + month *time.Time +} + +func (r apiGetUsageBillableSummaryRequest) Month(month time.Time) apiGetUsageBillableSummaryRequest { + r.month = &month + return r +} + +/* +GetUsageBillableSummary Get monthly billable summary +Get the monthly billable summary. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return apiGetUsageBillableSummaryRequest +*/ +func (a *UsageMeteringApiService) GetUsageBillableSummary(ctx _context.Context) apiGetUsageBillableSummaryRequest { + return apiGetUsageBillableSummaryRequest{ + apiService: a, + ctx: ctx, + } +} + +/* +Execute executes the request + @return UsageBillableSummaryResponse +*/ +func (r apiGetUsageBillableSummaryRequest) Execute() (UsageBillableSummaryResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UsageBillableSummaryResponse + ) + + localBasePath, err := r.apiService.client.cfg.ServerURLWithContext(r.ctx, "UsageMeteringApiService.GetUsageBillableSummary") + if err != nil { + return localVarReturnValue, nil, GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/usage/billable-summary" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if r.month != nil { + localVarQueryParams.Add("month", parameterToString(*r.month, "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json;datetime-format=rfc3339"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + + // Set Operation-ID header for telemetry + localVarHeaderParams["DD-OPERATION-ID"] = "GetUsageBillableSummary" + + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["apiKeyAuth"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["DD-API-KEY"] = key + } + } + } + if r.ctx != nil { + // API Key Authentication + if auth, ok := r.ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["appKeyAuth"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["DD-APPLICATION-KEY"] = key + } + } + } + req, err := r.apiService.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := r.apiService.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v APIErrorResponse + err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v APIErrorResponse + err = r.apiService.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = r.apiService.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type apiGetUsageFargateRequest struct { ctx _context.Context apiService *UsageMeteringApiService diff --git a/api/v1/datadog/docs/UsageBillableSummaryBody.md b/api/v1/datadog/docs/UsageBillableSummaryBody.md new file mode 100644 index 00000000000..a7892983317 --- /dev/null +++ b/api/v1/datadog/docs/UsageBillableSummaryBody.md @@ -0,0 +1,212 @@ +# UsageBillableSummaryBody + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountBillableUsage** | Pointer to **int64** | The total account usage. | [optional] +**ElapsedUsageHours** | Pointer to **int64** | Elapsed usage hours for some billable product. | [optional] +**FirstBillableUsageHour** | Pointer to [**time.Time**](time.Time.md) | The first billable hour for the org. | [optional] +**LastBillableUsageHour** | Pointer to [**time.Time**](time.Time.md) | The last billable hour for the org. | [optional] +**OrgBillableUsage** | Pointer to **int64** | The number of units used within the billable timeframe. | [optional] +**PercentageInAccount** | Pointer to **float64** | The percentage of account usage the org represents. | [optional] +**UsageUnit** | Pointer to **string** | Units pertaining to the usage. | [optional] + +## Methods + +### NewUsageBillableSummaryBody + +`func NewUsageBillableSummaryBody() *UsageBillableSummaryBody` + +NewUsageBillableSummaryBody instantiates a new UsageBillableSummaryBody object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageBillableSummaryBodyWithDefaults + +`func NewUsageBillableSummaryBodyWithDefaults() *UsageBillableSummaryBody` + +NewUsageBillableSummaryBodyWithDefaults instantiates a new UsageBillableSummaryBody object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetAccountBillableUsage + +`func (o *UsageBillableSummaryBody) GetAccountBillableUsage() int64` + +GetAccountBillableUsage returns the AccountBillableUsage field if non-nil, zero value otherwise. + +### GetAccountBillableUsageOk + +`func (o *UsageBillableSummaryBody) GetAccountBillableUsageOk() (*int64, bool)` + +GetAccountBillableUsageOk returns a tuple with the AccountBillableUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetAccountBillableUsage + +`func (o *UsageBillableSummaryBody) SetAccountBillableUsage(v int64)` + +SetAccountBillableUsage sets AccountBillableUsage field to given value. + +### HasAccountBillableUsage + +`func (o *UsageBillableSummaryBody) HasAccountBillableUsage() bool` + +HasAccountBillableUsage returns a boolean if a field has been set. + +### GetElapsedUsageHours + +`func (o *UsageBillableSummaryBody) GetElapsedUsageHours() int64` + +GetElapsedUsageHours returns the ElapsedUsageHours field if non-nil, zero value otherwise. + +### GetElapsedUsageHoursOk + +`func (o *UsageBillableSummaryBody) GetElapsedUsageHoursOk() (*int64, bool)` + +GetElapsedUsageHoursOk returns a tuple with the ElapsedUsageHours field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetElapsedUsageHours + +`func (o *UsageBillableSummaryBody) SetElapsedUsageHours(v int64)` + +SetElapsedUsageHours sets ElapsedUsageHours field to given value. + +### HasElapsedUsageHours + +`func (o *UsageBillableSummaryBody) HasElapsedUsageHours() bool` + +HasElapsedUsageHours returns a boolean if a field has been set. + +### GetFirstBillableUsageHour + +`func (o *UsageBillableSummaryBody) GetFirstBillableUsageHour() time.Time` + +GetFirstBillableUsageHour returns the FirstBillableUsageHour field if non-nil, zero value otherwise. + +### GetFirstBillableUsageHourOk + +`func (o *UsageBillableSummaryBody) GetFirstBillableUsageHourOk() (*time.Time, bool)` + +GetFirstBillableUsageHourOk returns a tuple with the FirstBillableUsageHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFirstBillableUsageHour + +`func (o *UsageBillableSummaryBody) SetFirstBillableUsageHour(v time.Time)` + +SetFirstBillableUsageHour sets FirstBillableUsageHour field to given value. + +### HasFirstBillableUsageHour + +`func (o *UsageBillableSummaryBody) HasFirstBillableUsageHour() bool` + +HasFirstBillableUsageHour returns a boolean if a field has been set. + +### GetLastBillableUsageHour + +`func (o *UsageBillableSummaryBody) GetLastBillableUsageHour() time.Time` + +GetLastBillableUsageHour returns the LastBillableUsageHour field if non-nil, zero value otherwise. + +### GetLastBillableUsageHourOk + +`func (o *UsageBillableSummaryBody) GetLastBillableUsageHourOk() (*time.Time, bool)` + +GetLastBillableUsageHourOk returns a tuple with the LastBillableUsageHour field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLastBillableUsageHour + +`func (o *UsageBillableSummaryBody) SetLastBillableUsageHour(v time.Time)` + +SetLastBillableUsageHour sets LastBillableUsageHour field to given value. + +### HasLastBillableUsageHour + +`func (o *UsageBillableSummaryBody) HasLastBillableUsageHour() bool` + +HasLastBillableUsageHour returns a boolean if a field has been set. + +### GetOrgBillableUsage + +`func (o *UsageBillableSummaryBody) GetOrgBillableUsage() int64` + +GetOrgBillableUsage returns the OrgBillableUsage field if non-nil, zero value otherwise. + +### GetOrgBillableUsageOk + +`func (o *UsageBillableSummaryBody) GetOrgBillableUsageOk() (*int64, bool)` + +GetOrgBillableUsageOk returns a tuple with the OrgBillableUsage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrgBillableUsage + +`func (o *UsageBillableSummaryBody) SetOrgBillableUsage(v int64)` + +SetOrgBillableUsage sets OrgBillableUsage field to given value. + +### HasOrgBillableUsage + +`func (o *UsageBillableSummaryBody) HasOrgBillableUsage() bool` + +HasOrgBillableUsage returns a boolean if a field has been set. + +### GetPercentageInAccount + +`func (o *UsageBillableSummaryBody) GetPercentageInAccount() float64` + +GetPercentageInAccount returns the PercentageInAccount field if non-nil, zero value otherwise. + +### GetPercentageInAccountOk + +`func (o *UsageBillableSummaryBody) GetPercentageInAccountOk() (*float64, bool)` + +GetPercentageInAccountOk returns a tuple with the PercentageInAccount field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPercentageInAccount + +`func (o *UsageBillableSummaryBody) SetPercentageInAccount(v float64)` + +SetPercentageInAccount sets PercentageInAccount field to given value. + +### HasPercentageInAccount + +`func (o *UsageBillableSummaryBody) HasPercentageInAccount() bool` + +HasPercentageInAccount returns a boolean if a field has been set. + +### GetUsageUnit + +`func (o *UsageBillableSummaryBody) GetUsageUnit() string` + +GetUsageUnit returns the UsageUnit field if non-nil, zero value otherwise. + +### GetUsageUnitOk + +`func (o *UsageBillableSummaryBody) GetUsageUnitOk() (*string, bool)` + +GetUsageUnitOk returns a tuple with the UsageUnit field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsageUnit + +`func (o *UsageBillableSummaryBody) SetUsageUnit(v string)` + +SetUsageUnit sets UsageUnit field to given value. + +### HasUsageUnit + +`func (o *UsageBillableSummaryBody) HasUsageUnit() bool` + +HasUsageUnit returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/UsageBillableSummaryHour.md b/api/v1/datadog/docs/UsageBillableSummaryHour.md new file mode 100644 index 00000000000..6836c815d39 --- /dev/null +++ b/api/v1/datadog/docs/UsageBillableSummaryHour.md @@ -0,0 +1,238 @@ +# UsageBillableSummaryHour + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingPlan** | Pointer to **string** | The billing plan. | [optional] +**EndDate** | Pointer to [**time.Time**](time.Time.md) | Shows the last date of usage. | [optional] +**NumOrgs** | Pointer to **int64** | The number of organizations. | [optional] +**OrgName** | Pointer to **string** | The organization name. | [optional] +**PublicId** | Pointer to **string** | The organization public ID. | [optional] +**RatioInMonth** | Pointer to **int64** | Shows usage aggregation for a billing period. | [optional] +**StartDate** | Pointer to [**time.Time**](time.Time.md) | Shows the first date of usage. | [optional] +**Usage** | Pointer to [**UsageBillableSummaryKeys**](UsageBillableSummaryKeys.md) | | [optional] + +## Methods + +### NewUsageBillableSummaryHour + +`func NewUsageBillableSummaryHour() *UsageBillableSummaryHour` + +NewUsageBillableSummaryHour instantiates a new UsageBillableSummaryHour object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageBillableSummaryHourWithDefaults + +`func NewUsageBillableSummaryHourWithDefaults() *UsageBillableSummaryHour` + +NewUsageBillableSummaryHourWithDefaults instantiates a new UsageBillableSummaryHour object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetBillingPlan + +`func (o *UsageBillableSummaryHour) GetBillingPlan() string` + +GetBillingPlan returns the BillingPlan field if non-nil, zero value otherwise. + +### GetBillingPlanOk + +`func (o *UsageBillableSummaryHour) GetBillingPlanOk() (*string, bool)` + +GetBillingPlanOk returns a tuple with the BillingPlan field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetBillingPlan + +`func (o *UsageBillableSummaryHour) SetBillingPlan(v string)` + +SetBillingPlan sets BillingPlan field to given value. + +### HasBillingPlan + +`func (o *UsageBillableSummaryHour) HasBillingPlan() bool` + +HasBillingPlan returns a boolean if a field has been set. + +### GetEndDate + +`func (o *UsageBillableSummaryHour) GetEndDate() time.Time` + +GetEndDate returns the EndDate field if non-nil, zero value otherwise. + +### GetEndDateOk + +`func (o *UsageBillableSummaryHour) GetEndDateOk() (*time.Time, bool)` + +GetEndDateOk returns a tuple with the EndDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetEndDate + +`func (o *UsageBillableSummaryHour) SetEndDate(v time.Time)` + +SetEndDate sets EndDate field to given value. + +### HasEndDate + +`func (o *UsageBillableSummaryHour) HasEndDate() bool` + +HasEndDate returns a boolean if a field has been set. + +### GetNumOrgs + +`func (o *UsageBillableSummaryHour) GetNumOrgs() int64` + +GetNumOrgs returns the NumOrgs field if non-nil, zero value otherwise. + +### GetNumOrgsOk + +`func (o *UsageBillableSummaryHour) GetNumOrgsOk() (*int64, bool)` + +GetNumOrgsOk returns a tuple with the NumOrgs field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNumOrgs + +`func (o *UsageBillableSummaryHour) SetNumOrgs(v int64)` + +SetNumOrgs sets NumOrgs field to given value. + +### HasNumOrgs + +`func (o *UsageBillableSummaryHour) HasNumOrgs() bool` + +HasNumOrgs returns a boolean if a field has been set. + +### GetOrgName + +`func (o *UsageBillableSummaryHour) GetOrgName() string` + +GetOrgName returns the OrgName field if non-nil, zero value otherwise. + +### GetOrgNameOk + +`func (o *UsageBillableSummaryHour) GetOrgNameOk() (*string, bool)` + +GetOrgNameOk returns a tuple with the OrgName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetOrgName + +`func (o *UsageBillableSummaryHour) SetOrgName(v string)` + +SetOrgName sets OrgName field to given value. + +### HasOrgName + +`func (o *UsageBillableSummaryHour) HasOrgName() bool` + +HasOrgName returns a boolean if a field has been set. + +### GetPublicId + +`func (o *UsageBillableSummaryHour) GetPublicId() string` + +GetPublicId returns the PublicId field if non-nil, zero value otherwise. + +### GetPublicIdOk + +`func (o *UsageBillableSummaryHour) GetPublicIdOk() (*string, bool)` + +GetPublicIdOk returns a tuple with the PublicId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetPublicId + +`func (o *UsageBillableSummaryHour) SetPublicId(v string)` + +SetPublicId sets PublicId field to given value. + +### HasPublicId + +`func (o *UsageBillableSummaryHour) HasPublicId() bool` + +HasPublicId returns a boolean if a field has been set. + +### GetRatioInMonth + +`func (o *UsageBillableSummaryHour) GetRatioInMonth() int64` + +GetRatioInMonth returns the RatioInMonth field if non-nil, zero value otherwise. + +### GetRatioInMonthOk + +`func (o *UsageBillableSummaryHour) GetRatioInMonthOk() (*int64, bool)` + +GetRatioInMonthOk returns a tuple with the RatioInMonth field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRatioInMonth + +`func (o *UsageBillableSummaryHour) SetRatioInMonth(v int64)` + +SetRatioInMonth sets RatioInMonth field to given value. + +### HasRatioInMonth + +`func (o *UsageBillableSummaryHour) HasRatioInMonth() bool` + +HasRatioInMonth returns a boolean if a field has been set. + +### GetStartDate + +`func (o *UsageBillableSummaryHour) GetStartDate() time.Time` + +GetStartDate returns the StartDate field if non-nil, zero value otherwise. + +### GetStartDateOk + +`func (o *UsageBillableSummaryHour) GetStartDateOk() (*time.Time, bool)` + +GetStartDateOk returns a tuple with the StartDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetStartDate + +`func (o *UsageBillableSummaryHour) SetStartDate(v time.Time)` + +SetStartDate sets StartDate field to given value. + +### HasStartDate + +`func (o *UsageBillableSummaryHour) HasStartDate() bool` + +HasStartDate returns a boolean if a field has been set. + +### GetUsage + +`func (o *UsageBillableSummaryHour) GetUsage() UsageBillableSummaryKeys` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *UsageBillableSummaryHour) GetUsageOk() (*UsageBillableSummaryKeys, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *UsageBillableSummaryHour) SetUsage(v UsageBillableSummaryKeys)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *UsageBillableSummaryHour) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/UsageBillableSummaryKeys.md b/api/v1/datadog/docs/UsageBillableSummaryKeys.md new file mode 100644 index 00000000000..1af54babdf7 --- /dev/null +++ b/api/v1/datadog/docs/UsageBillableSummaryKeys.md @@ -0,0 +1,498 @@ +# UsageBillableSummaryKeys + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApmHostSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**ApmHostTop99p** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**ApmTraceSearchSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**FargateContainerAverage** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**InfraContainerSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**InfraHostSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**InfraHostTop99p** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**IotTop99p** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**LambdaFunctionAverage** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**LogsIndexedSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**LogsIngestedSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**NpmFlowSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**NpmHostTop99p** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**RumSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**SiemSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**SyntheticsApiTestsSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**SyntheticsBrowserChecksSum** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] +**TimeseriesAverage** | Pointer to [**UsageBillableSummaryBody**](UsageBillableSummaryBody.md) | | [optional] + +## Methods + +### NewUsageBillableSummaryKeys + +`func NewUsageBillableSummaryKeys() *UsageBillableSummaryKeys` + +NewUsageBillableSummaryKeys instantiates a new UsageBillableSummaryKeys object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageBillableSummaryKeysWithDefaults + +`func NewUsageBillableSummaryKeysWithDefaults() *UsageBillableSummaryKeys` + +NewUsageBillableSummaryKeysWithDefaults instantiates a new UsageBillableSummaryKeys object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetApmHostSum + +`func (o *UsageBillableSummaryKeys) GetApmHostSum() UsageBillableSummaryBody` + +GetApmHostSum returns the ApmHostSum field if non-nil, zero value otherwise. + +### GetApmHostSumOk + +`func (o *UsageBillableSummaryKeys) GetApmHostSumOk() (*UsageBillableSummaryBody, bool)` + +GetApmHostSumOk returns a tuple with the ApmHostSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApmHostSum + +`func (o *UsageBillableSummaryKeys) SetApmHostSum(v UsageBillableSummaryBody)` + +SetApmHostSum sets ApmHostSum field to given value. + +### HasApmHostSum + +`func (o *UsageBillableSummaryKeys) HasApmHostSum() bool` + +HasApmHostSum returns a boolean if a field has been set. + +### GetApmHostTop99p + +`func (o *UsageBillableSummaryKeys) GetApmHostTop99p() UsageBillableSummaryBody` + +GetApmHostTop99p returns the ApmHostTop99p field if non-nil, zero value otherwise. + +### GetApmHostTop99pOk + +`func (o *UsageBillableSummaryKeys) GetApmHostTop99pOk() (*UsageBillableSummaryBody, bool)` + +GetApmHostTop99pOk returns a tuple with the ApmHostTop99p field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApmHostTop99p + +`func (o *UsageBillableSummaryKeys) SetApmHostTop99p(v UsageBillableSummaryBody)` + +SetApmHostTop99p sets ApmHostTop99p field to given value. + +### HasApmHostTop99p + +`func (o *UsageBillableSummaryKeys) HasApmHostTop99p() bool` + +HasApmHostTop99p returns a boolean if a field has been set. + +### GetApmTraceSearchSum + +`func (o *UsageBillableSummaryKeys) GetApmTraceSearchSum() UsageBillableSummaryBody` + +GetApmTraceSearchSum returns the ApmTraceSearchSum field if non-nil, zero value otherwise. + +### GetApmTraceSearchSumOk + +`func (o *UsageBillableSummaryKeys) GetApmTraceSearchSumOk() (*UsageBillableSummaryBody, bool)` + +GetApmTraceSearchSumOk returns a tuple with the ApmTraceSearchSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetApmTraceSearchSum + +`func (o *UsageBillableSummaryKeys) SetApmTraceSearchSum(v UsageBillableSummaryBody)` + +SetApmTraceSearchSum sets ApmTraceSearchSum field to given value. + +### HasApmTraceSearchSum + +`func (o *UsageBillableSummaryKeys) HasApmTraceSearchSum() bool` + +HasApmTraceSearchSum returns a boolean if a field has been set. + +### GetFargateContainerAverage + +`func (o *UsageBillableSummaryKeys) GetFargateContainerAverage() UsageBillableSummaryBody` + +GetFargateContainerAverage returns the FargateContainerAverage field if non-nil, zero value otherwise. + +### GetFargateContainerAverageOk + +`func (o *UsageBillableSummaryKeys) GetFargateContainerAverageOk() (*UsageBillableSummaryBody, bool)` + +GetFargateContainerAverageOk returns a tuple with the FargateContainerAverage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetFargateContainerAverage + +`func (o *UsageBillableSummaryKeys) SetFargateContainerAverage(v UsageBillableSummaryBody)` + +SetFargateContainerAverage sets FargateContainerAverage field to given value. + +### HasFargateContainerAverage + +`func (o *UsageBillableSummaryKeys) HasFargateContainerAverage() bool` + +HasFargateContainerAverage returns a boolean if a field has been set. + +### GetInfraContainerSum + +`func (o *UsageBillableSummaryKeys) GetInfraContainerSum() UsageBillableSummaryBody` + +GetInfraContainerSum returns the InfraContainerSum field if non-nil, zero value otherwise. + +### GetInfraContainerSumOk + +`func (o *UsageBillableSummaryKeys) GetInfraContainerSumOk() (*UsageBillableSummaryBody, bool)` + +GetInfraContainerSumOk returns a tuple with the InfraContainerSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInfraContainerSum + +`func (o *UsageBillableSummaryKeys) SetInfraContainerSum(v UsageBillableSummaryBody)` + +SetInfraContainerSum sets InfraContainerSum field to given value. + +### HasInfraContainerSum + +`func (o *UsageBillableSummaryKeys) HasInfraContainerSum() bool` + +HasInfraContainerSum returns a boolean if a field has been set. + +### GetInfraHostSum + +`func (o *UsageBillableSummaryKeys) GetInfraHostSum() UsageBillableSummaryBody` + +GetInfraHostSum returns the InfraHostSum field if non-nil, zero value otherwise. + +### GetInfraHostSumOk + +`func (o *UsageBillableSummaryKeys) GetInfraHostSumOk() (*UsageBillableSummaryBody, bool)` + +GetInfraHostSumOk returns a tuple with the InfraHostSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInfraHostSum + +`func (o *UsageBillableSummaryKeys) SetInfraHostSum(v UsageBillableSummaryBody)` + +SetInfraHostSum sets InfraHostSum field to given value. + +### HasInfraHostSum + +`func (o *UsageBillableSummaryKeys) HasInfraHostSum() bool` + +HasInfraHostSum returns a boolean if a field has been set. + +### GetInfraHostTop99p + +`func (o *UsageBillableSummaryKeys) GetInfraHostTop99p() UsageBillableSummaryBody` + +GetInfraHostTop99p returns the InfraHostTop99p field if non-nil, zero value otherwise. + +### GetInfraHostTop99pOk + +`func (o *UsageBillableSummaryKeys) GetInfraHostTop99pOk() (*UsageBillableSummaryBody, bool)` + +GetInfraHostTop99pOk returns a tuple with the InfraHostTop99p field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetInfraHostTop99p + +`func (o *UsageBillableSummaryKeys) SetInfraHostTop99p(v UsageBillableSummaryBody)` + +SetInfraHostTop99p sets InfraHostTop99p field to given value. + +### HasInfraHostTop99p + +`func (o *UsageBillableSummaryKeys) HasInfraHostTop99p() bool` + +HasInfraHostTop99p returns a boolean if a field has been set. + +### GetIotTop99p + +`func (o *UsageBillableSummaryKeys) GetIotTop99p() UsageBillableSummaryBody` + +GetIotTop99p returns the IotTop99p field if non-nil, zero value otherwise. + +### GetIotTop99pOk + +`func (o *UsageBillableSummaryKeys) GetIotTop99pOk() (*UsageBillableSummaryBody, bool)` + +GetIotTop99pOk returns a tuple with the IotTop99p field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetIotTop99p + +`func (o *UsageBillableSummaryKeys) SetIotTop99p(v UsageBillableSummaryBody)` + +SetIotTop99p sets IotTop99p field to given value. + +### HasIotTop99p + +`func (o *UsageBillableSummaryKeys) HasIotTop99p() bool` + +HasIotTop99p returns a boolean if a field has been set. + +### GetLambdaFunctionAverage + +`func (o *UsageBillableSummaryKeys) GetLambdaFunctionAverage() UsageBillableSummaryBody` + +GetLambdaFunctionAverage returns the LambdaFunctionAverage field if non-nil, zero value otherwise. + +### GetLambdaFunctionAverageOk + +`func (o *UsageBillableSummaryKeys) GetLambdaFunctionAverageOk() (*UsageBillableSummaryBody, bool)` + +GetLambdaFunctionAverageOk returns a tuple with the LambdaFunctionAverage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLambdaFunctionAverage + +`func (o *UsageBillableSummaryKeys) SetLambdaFunctionAverage(v UsageBillableSummaryBody)` + +SetLambdaFunctionAverage sets LambdaFunctionAverage field to given value. + +### HasLambdaFunctionAverage + +`func (o *UsageBillableSummaryKeys) HasLambdaFunctionAverage() bool` + +HasLambdaFunctionAverage returns a boolean if a field has been set. + +### GetLogsIndexedSum + +`func (o *UsageBillableSummaryKeys) GetLogsIndexedSum() UsageBillableSummaryBody` + +GetLogsIndexedSum returns the LogsIndexedSum field if non-nil, zero value otherwise. + +### GetLogsIndexedSumOk + +`func (o *UsageBillableSummaryKeys) GetLogsIndexedSumOk() (*UsageBillableSummaryBody, bool)` + +GetLogsIndexedSumOk returns a tuple with the LogsIndexedSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogsIndexedSum + +`func (o *UsageBillableSummaryKeys) SetLogsIndexedSum(v UsageBillableSummaryBody)` + +SetLogsIndexedSum sets LogsIndexedSum field to given value. + +### HasLogsIndexedSum + +`func (o *UsageBillableSummaryKeys) HasLogsIndexedSum() bool` + +HasLogsIndexedSum returns a boolean if a field has been set. + +### GetLogsIngestedSum + +`func (o *UsageBillableSummaryKeys) GetLogsIngestedSum() UsageBillableSummaryBody` + +GetLogsIngestedSum returns the LogsIngestedSum field if non-nil, zero value otherwise. + +### GetLogsIngestedSumOk + +`func (o *UsageBillableSummaryKeys) GetLogsIngestedSumOk() (*UsageBillableSummaryBody, bool)` + +GetLogsIngestedSumOk returns a tuple with the LogsIngestedSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetLogsIngestedSum + +`func (o *UsageBillableSummaryKeys) SetLogsIngestedSum(v UsageBillableSummaryBody)` + +SetLogsIngestedSum sets LogsIngestedSum field to given value. + +### HasLogsIngestedSum + +`func (o *UsageBillableSummaryKeys) HasLogsIngestedSum() bool` + +HasLogsIngestedSum returns a boolean if a field has been set. + +### GetNpmFlowSum + +`func (o *UsageBillableSummaryKeys) GetNpmFlowSum() UsageBillableSummaryBody` + +GetNpmFlowSum returns the NpmFlowSum field if non-nil, zero value otherwise. + +### GetNpmFlowSumOk + +`func (o *UsageBillableSummaryKeys) GetNpmFlowSumOk() (*UsageBillableSummaryBody, bool)` + +GetNpmFlowSumOk returns a tuple with the NpmFlowSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNpmFlowSum + +`func (o *UsageBillableSummaryKeys) SetNpmFlowSum(v UsageBillableSummaryBody)` + +SetNpmFlowSum sets NpmFlowSum field to given value. + +### HasNpmFlowSum + +`func (o *UsageBillableSummaryKeys) HasNpmFlowSum() bool` + +HasNpmFlowSum returns a boolean if a field has been set. + +### GetNpmHostTop99p + +`func (o *UsageBillableSummaryKeys) GetNpmHostTop99p() UsageBillableSummaryBody` + +GetNpmHostTop99p returns the NpmHostTop99p field if non-nil, zero value otherwise. + +### GetNpmHostTop99pOk + +`func (o *UsageBillableSummaryKeys) GetNpmHostTop99pOk() (*UsageBillableSummaryBody, bool)` + +GetNpmHostTop99pOk returns a tuple with the NpmHostTop99p field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetNpmHostTop99p + +`func (o *UsageBillableSummaryKeys) SetNpmHostTop99p(v UsageBillableSummaryBody)` + +SetNpmHostTop99p sets NpmHostTop99p field to given value. + +### HasNpmHostTop99p + +`func (o *UsageBillableSummaryKeys) HasNpmHostTop99p() bool` + +HasNpmHostTop99p returns a boolean if a field has been set. + +### GetRumSum + +`func (o *UsageBillableSummaryKeys) GetRumSum() UsageBillableSummaryBody` + +GetRumSum returns the RumSum field if non-nil, zero value otherwise. + +### GetRumSumOk + +`func (o *UsageBillableSummaryKeys) GetRumSumOk() (*UsageBillableSummaryBody, bool)` + +GetRumSumOk returns a tuple with the RumSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetRumSum + +`func (o *UsageBillableSummaryKeys) SetRumSum(v UsageBillableSummaryBody)` + +SetRumSum sets RumSum field to given value. + +### HasRumSum + +`func (o *UsageBillableSummaryKeys) HasRumSum() bool` + +HasRumSum returns a boolean if a field has been set. + +### GetSiemSum + +`func (o *UsageBillableSummaryKeys) GetSiemSum() UsageBillableSummaryBody` + +GetSiemSum returns the SiemSum field if non-nil, zero value otherwise. + +### GetSiemSumOk + +`func (o *UsageBillableSummaryKeys) GetSiemSumOk() (*UsageBillableSummaryBody, bool)` + +GetSiemSumOk returns a tuple with the SiemSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSiemSum + +`func (o *UsageBillableSummaryKeys) SetSiemSum(v UsageBillableSummaryBody)` + +SetSiemSum sets SiemSum field to given value. + +### HasSiemSum + +`func (o *UsageBillableSummaryKeys) HasSiemSum() bool` + +HasSiemSum returns a boolean if a field has been set. + +### GetSyntheticsApiTestsSum + +`func (o *UsageBillableSummaryKeys) GetSyntheticsApiTestsSum() UsageBillableSummaryBody` + +GetSyntheticsApiTestsSum returns the SyntheticsApiTestsSum field if non-nil, zero value otherwise. + +### GetSyntheticsApiTestsSumOk + +`func (o *UsageBillableSummaryKeys) GetSyntheticsApiTestsSumOk() (*UsageBillableSummaryBody, bool)` + +GetSyntheticsApiTestsSumOk returns a tuple with the SyntheticsApiTestsSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSyntheticsApiTestsSum + +`func (o *UsageBillableSummaryKeys) SetSyntheticsApiTestsSum(v UsageBillableSummaryBody)` + +SetSyntheticsApiTestsSum sets SyntheticsApiTestsSum field to given value. + +### HasSyntheticsApiTestsSum + +`func (o *UsageBillableSummaryKeys) HasSyntheticsApiTestsSum() bool` + +HasSyntheticsApiTestsSum returns a boolean if a field has been set. + +### GetSyntheticsBrowserChecksSum + +`func (o *UsageBillableSummaryKeys) GetSyntheticsBrowserChecksSum() UsageBillableSummaryBody` + +GetSyntheticsBrowserChecksSum returns the SyntheticsBrowserChecksSum field if non-nil, zero value otherwise. + +### GetSyntheticsBrowserChecksSumOk + +`func (o *UsageBillableSummaryKeys) GetSyntheticsBrowserChecksSumOk() (*UsageBillableSummaryBody, bool)` + +GetSyntheticsBrowserChecksSumOk returns a tuple with the SyntheticsBrowserChecksSum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetSyntheticsBrowserChecksSum + +`func (o *UsageBillableSummaryKeys) SetSyntheticsBrowserChecksSum(v UsageBillableSummaryBody)` + +SetSyntheticsBrowserChecksSum sets SyntheticsBrowserChecksSum field to given value. + +### HasSyntheticsBrowserChecksSum + +`func (o *UsageBillableSummaryKeys) HasSyntheticsBrowserChecksSum() bool` + +HasSyntheticsBrowserChecksSum returns a boolean if a field has been set. + +### GetTimeseriesAverage + +`func (o *UsageBillableSummaryKeys) GetTimeseriesAverage() UsageBillableSummaryBody` + +GetTimeseriesAverage returns the TimeseriesAverage field if non-nil, zero value otherwise. + +### GetTimeseriesAverageOk + +`func (o *UsageBillableSummaryKeys) GetTimeseriesAverageOk() (*UsageBillableSummaryBody, bool)` + +GetTimeseriesAverageOk returns a tuple with the TimeseriesAverage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetTimeseriesAverage + +`func (o *UsageBillableSummaryKeys) SetTimeseriesAverage(v UsageBillableSummaryBody)` + +SetTimeseriesAverage sets TimeseriesAverage field to given value. + +### HasTimeseriesAverage + +`func (o *UsageBillableSummaryKeys) HasTimeseriesAverage() bool` + +HasTimeseriesAverage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/UsageBillableSummaryResponse.md b/api/v1/datadog/docs/UsageBillableSummaryResponse.md new file mode 100644 index 00000000000..2482541a08b --- /dev/null +++ b/api/v1/datadog/docs/UsageBillableSummaryResponse.md @@ -0,0 +1,56 @@ +# UsageBillableSummaryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Usage** | Pointer to [**[]UsageBillableSummaryHour**](UsageBillableSummaryHour.md) | An array of objects regarding usage of billable summary. | [optional] + +## Methods + +### NewUsageBillableSummaryResponse + +`func NewUsageBillableSummaryResponse() *UsageBillableSummaryResponse` + +NewUsageBillableSummaryResponse instantiates a new UsageBillableSummaryResponse object +This constructor will assign default values to properties that have it defined, +and makes sure properties required by API are set, but the set of arguments +will change when the set of required properties is changed + +### NewUsageBillableSummaryResponseWithDefaults + +`func NewUsageBillableSummaryResponseWithDefaults() *UsageBillableSummaryResponse` + +NewUsageBillableSummaryResponseWithDefaults instantiates a new UsageBillableSummaryResponse object +This constructor will only assign default values to properties that have it defined, +but it doesn't guarantee that properties required by API are set + +### GetUsage + +`func (o *UsageBillableSummaryResponse) GetUsage() []UsageBillableSummaryHour` + +GetUsage returns the Usage field if non-nil, zero value otherwise. + +### GetUsageOk + +`func (o *UsageBillableSummaryResponse) GetUsageOk() (*[]UsageBillableSummaryHour, bool)` + +GetUsageOk returns a tuple with the Usage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetUsage + +`func (o *UsageBillableSummaryResponse) SetUsage(v []UsageBillableSummaryHour)` + +SetUsage sets Usage field to given value. + +### HasUsage + +`func (o *UsageBillableSummaryResponse) HasUsage() bool` + +HasUsage returns a boolean if a field has been set. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/api/v1/datadog/docs/UsageMeteringApi.md b/api/v1/datadog/docs/UsageMeteringApi.md index cc060f1b1aa..a6743307d3d 100644 --- a/api/v1/datadog/docs/UsageMeteringApi.md +++ b/api/v1/datadog/docs/UsageMeteringApi.md @@ -5,6 +5,7 @@ All URIs are relative to *https://api.datadoghq.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**GetUsageAnalyzedLogs**](UsageMeteringApi.md#GetUsageAnalyzedLogs) | **Get** /api/v1/usage/analyzed_logs | Get hourly usage for analyzed logs +[**GetUsageBillableSummary**](UsageMeteringApi.md#GetUsageBillableSummary) | **Get** /api/v1/usage/billable-summary | Get monthly billable summary [**GetUsageFargate**](UsageMeteringApi.md#GetUsageFargate) | **Get** /api/v1/usage/fargate | Get hourly usage for Fargate [**GetUsageHosts**](UsageMeteringApi.md#GetUsageHosts) | **Get** /api/v1/usage/hosts | Get hourly usage for hosts and containers [**GetUsageLambda**](UsageMeteringApi.md#GetUsageLambda) | **Get** /api/v1/usage/aws_lambda | Get hourly usage for Lambda @@ -105,6 +106,85 @@ Name | Type | Description | Notes [[Back to README]](../README.md) +## GetUsageBillableSummary + +> UsageBillableSummaryResponse GetUsageBillableSummary(ctx).Month(month).Execute() + +Get monthly billable summary + + + +### Example + +```go +package main + +import ( + "context" + "fmt" + "os" + datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog" +) + +func main() { + ctx := context.WithValue( + context.Background(), + datadog.ContextAPIKeys, + map[string]datadog.APIKey{ + "apiKeyAuth": { + Key: os.Getenv("DD_CLIENT_API_KEY"), + }, + "appKeyAuth": { + Key: os.Getenv("DD_CLIENT_APP_KEY"), + }, + }, + ) + + month := Get-Date // time.Time | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage starting this month. (optional) + + configuration := datadog.NewConfiguration() + api_client := datadog.NewAPIClient(configuration) + resp, r, err := api_client.UsageMeteringApi.GetUsageBillableSummary(ctx).Month(month).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsageMeteringApi.GetUsageBillableSummary``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUsageBillableSummary`: UsageBillableSummaryResponse + fmt.Fprintf(os.Stdout, "Response from `UsageMeteringApi.GetUsageBillableSummary`: %v\n", resp) +} +``` + +### Path Parameters + + + +### Other Parameters + +Other parameters are passed through a pointer to a apiGetUsageBillableSummaryRequest struct via the builder pattern + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **month** | **time.Time** | Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]` for usage starting this month. | + +### Return type + +[**UsageBillableSummaryResponse**](UsageBillableSummaryResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json;datetime-format=rfc3339 + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + ## GetUsageFargate > UsageFargateResponse GetUsageFargate(ctx).StartHr(startHr).EndHr(endHr).Execute() diff --git a/api/v1/datadog/model_usage_billable_summary_body.go b/api/v1/datadog/model_usage_billable_summary_body.go new file mode 100644 index 00000000000..5e84c484cd4 --- /dev/null +++ b/api/v1/datadog/model_usage_billable_summary_body.go @@ -0,0 +1,335 @@ +/* + * 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. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" + "time" +) + +// UsageBillableSummaryBody Response with properties for each aggregated usage type. +type UsageBillableSummaryBody struct { + // The total account usage. + AccountBillableUsage *int64 `json:"account_billable_usage,omitempty"` + // Elapsed usage hours for some billable product. + ElapsedUsageHours *int64 `json:"elapsed_usage_hours,omitempty"` + // The first billable hour for the org. + FirstBillableUsageHour *time.Time `json:"first_billable_usage_hour,omitempty"` + // The last billable hour for the org. + LastBillableUsageHour *time.Time `json:"last_billable_usage_hour,omitempty"` + // The number of units used within the billable timeframe. + OrgBillableUsage *int64 `json:"org_billable_usage,omitempty"` + // The percentage of account usage the org represents. + PercentageInAccount *float64 `json:"percentage_in_account,omitempty"` + // Units pertaining to the usage. + UsageUnit *string `json:"usage_unit,omitempty"` +} + +// NewUsageBillableSummaryBody instantiates a new UsageBillableSummaryBody object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageBillableSummaryBody() *UsageBillableSummaryBody { + this := UsageBillableSummaryBody{} + return &this +} + +// NewUsageBillableSummaryBodyWithDefaults instantiates a new UsageBillableSummaryBody object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageBillableSummaryBodyWithDefaults() *UsageBillableSummaryBody { + this := UsageBillableSummaryBody{} + return &this +} + +// GetAccountBillableUsage returns the AccountBillableUsage field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetAccountBillableUsage() int64 { + if o == nil || o.AccountBillableUsage == nil { + var ret int64 + return ret + } + return *o.AccountBillableUsage +} + +// GetAccountBillableUsageOk returns a tuple with the AccountBillableUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetAccountBillableUsageOk() (*int64, bool) { + if o == nil || o.AccountBillableUsage == nil { + return nil, false + } + return o.AccountBillableUsage, true +} + +// HasAccountBillableUsage returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasAccountBillableUsage() bool { + if o != nil && o.AccountBillableUsage != nil { + return true + } + + return false +} + +// SetAccountBillableUsage gets a reference to the given int64 and assigns it to the AccountBillableUsage field. +func (o *UsageBillableSummaryBody) SetAccountBillableUsage(v int64) { + o.AccountBillableUsage = &v +} + +// GetElapsedUsageHours returns the ElapsedUsageHours field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetElapsedUsageHours() int64 { + if o == nil || o.ElapsedUsageHours == nil { + var ret int64 + return ret + } + return *o.ElapsedUsageHours +} + +// GetElapsedUsageHoursOk returns a tuple with the ElapsedUsageHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetElapsedUsageHoursOk() (*int64, bool) { + if o == nil || o.ElapsedUsageHours == nil { + return nil, false + } + return o.ElapsedUsageHours, true +} + +// HasElapsedUsageHours returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasElapsedUsageHours() bool { + if o != nil && o.ElapsedUsageHours != nil { + return true + } + + return false +} + +// SetElapsedUsageHours gets a reference to the given int64 and assigns it to the ElapsedUsageHours field. +func (o *UsageBillableSummaryBody) SetElapsedUsageHours(v int64) { + o.ElapsedUsageHours = &v +} + +// GetFirstBillableUsageHour returns the FirstBillableUsageHour field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetFirstBillableUsageHour() time.Time { + if o == nil || o.FirstBillableUsageHour == nil { + var ret time.Time + return ret + } + return *o.FirstBillableUsageHour +} + +// GetFirstBillableUsageHourOk returns a tuple with the FirstBillableUsageHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetFirstBillableUsageHourOk() (*time.Time, bool) { + if o == nil || o.FirstBillableUsageHour == nil { + return nil, false + } + return o.FirstBillableUsageHour, true +} + +// HasFirstBillableUsageHour returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasFirstBillableUsageHour() bool { + if o != nil && o.FirstBillableUsageHour != nil { + return true + } + + return false +} + +// SetFirstBillableUsageHour gets a reference to the given time.Time and assigns it to the FirstBillableUsageHour field. +func (o *UsageBillableSummaryBody) SetFirstBillableUsageHour(v time.Time) { + o.FirstBillableUsageHour = &v +} + +// GetLastBillableUsageHour returns the LastBillableUsageHour field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetLastBillableUsageHour() time.Time { + if o == nil || o.LastBillableUsageHour == nil { + var ret time.Time + return ret + } + return *o.LastBillableUsageHour +} + +// GetLastBillableUsageHourOk returns a tuple with the LastBillableUsageHour field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetLastBillableUsageHourOk() (*time.Time, bool) { + if o == nil || o.LastBillableUsageHour == nil { + return nil, false + } + return o.LastBillableUsageHour, true +} + +// HasLastBillableUsageHour returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasLastBillableUsageHour() bool { + if o != nil && o.LastBillableUsageHour != nil { + return true + } + + return false +} + +// SetLastBillableUsageHour gets a reference to the given time.Time and assigns it to the LastBillableUsageHour field. +func (o *UsageBillableSummaryBody) SetLastBillableUsageHour(v time.Time) { + o.LastBillableUsageHour = &v +} + +// GetOrgBillableUsage returns the OrgBillableUsage field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetOrgBillableUsage() int64 { + if o == nil || o.OrgBillableUsage == nil { + var ret int64 + return ret + } + return *o.OrgBillableUsage +} + +// GetOrgBillableUsageOk returns a tuple with the OrgBillableUsage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetOrgBillableUsageOk() (*int64, bool) { + if o == nil || o.OrgBillableUsage == nil { + return nil, false + } + return o.OrgBillableUsage, true +} + +// HasOrgBillableUsage returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasOrgBillableUsage() bool { + if o != nil && o.OrgBillableUsage != nil { + return true + } + + return false +} + +// SetOrgBillableUsage gets a reference to the given int64 and assigns it to the OrgBillableUsage field. +func (o *UsageBillableSummaryBody) SetOrgBillableUsage(v int64) { + o.OrgBillableUsage = &v +} + +// GetPercentageInAccount returns the PercentageInAccount field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetPercentageInAccount() float64 { + if o == nil || o.PercentageInAccount == nil { + var ret float64 + return ret + } + return *o.PercentageInAccount +} + +// GetPercentageInAccountOk returns a tuple with the PercentageInAccount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetPercentageInAccountOk() (*float64, bool) { + if o == nil || o.PercentageInAccount == nil { + return nil, false + } + return o.PercentageInAccount, true +} + +// HasPercentageInAccount returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasPercentageInAccount() bool { + if o != nil && o.PercentageInAccount != nil { + return true + } + + return false +} + +// SetPercentageInAccount gets a reference to the given float64 and assigns it to the PercentageInAccount field. +func (o *UsageBillableSummaryBody) SetPercentageInAccount(v float64) { + o.PercentageInAccount = &v +} + +// GetUsageUnit returns the UsageUnit field value if set, zero value otherwise. +func (o *UsageBillableSummaryBody) GetUsageUnit() string { + if o == nil || o.UsageUnit == nil { + var ret string + return ret + } + return *o.UsageUnit +} + +// GetUsageUnitOk returns a tuple with the UsageUnit field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryBody) GetUsageUnitOk() (*string, bool) { + if o == nil || o.UsageUnit == nil { + return nil, false + } + return o.UsageUnit, true +} + +// HasUsageUnit returns a boolean if a field has been set. +func (o *UsageBillableSummaryBody) HasUsageUnit() bool { + if o != nil && o.UsageUnit != nil { + return true + } + + return false +} + +// SetUsageUnit gets a reference to the given string and assigns it to the UsageUnit field. +func (o *UsageBillableSummaryBody) SetUsageUnit(v string) { + o.UsageUnit = &v +} + +func (o UsageBillableSummaryBody) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AccountBillableUsage != nil { + toSerialize["account_billable_usage"] = o.AccountBillableUsage + } + if o.ElapsedUsageHours != nil { + toSerialize["elapsed_usage_hours"] = o.ElapsedUsageHours + } + if o.FirstBillableUsageHour != nil { + toSerialize["first_billable_usage_hour"] = o.FirstBillableUsageHour + } + if o.LastBillableUsageHour != nil { + toSerialize["last_billable_usage_hour"] = o.LastBillableUsageHour + } + if o.OrgBillableUsage != nil { + toSerialize["org_billable_usage"] = o.OrgBillableUsage + } + if o.PercentageInAccount != nil { + toSerialize["percentage_in_account"] = o.PercentageInAccount + } + if o.UsageUnit != nil { + toSerialize["usage_unit"] = o.UsageUnit + } + return json.Marshal(toSerialize) +} + +type NullableUsageBillableSummaryBody struct { + value *UsageBillableSummaryBody + isSet bool +} + +func (v NullableUsageBillableSummaryBody) Get() *UsageBillableSummaryBody { + return v.value +} + +func (v *NullableUsageBillableSummaryBody) Set(val *UsageBillableSummaryBody) { + v.value = val + v.isSet = true +} + +func (v NullableUsageBillableSummaryBody) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageBillableSummaryBody) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageBillableSummaryBody(val *UsageBillableSummaryBody) *NullableUsageBillableSummaryBody { + return &NullableUsageBillableSummaryBody{value: val, isSet: true} +} + +func (v NullableUsageBillableSummaryBody) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageBillableSummaryBody) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_usage_billable_summary_hour.go b/api/v1/datadog/model_usage_billable_summary_hour.go new file mode 100644 index 00000000000..e21c881e9e6 --- /dev/null +++ b/api/v1/datadog/model_usage_billable_summary_hour.go @@ -0,0 +1,371 @@ +/* + * 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. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" + "time" +) + +// UsageBillableSummaryHour Response with monthly summary of data billed by Datadog. +type UsageBillableSummaryHour struct { + // The billing plan. + BillingPlan *string `json:"billing_plan,omitempty"` + // Shows the last date of usage. + EndDate *time.Time `json:"end_date,omitempty"` + // The number of organizations. + NumOrgs *int64 `json:"num_orgs,omitempty"` + // The organization name. + OrgName *string `json:"org_name,omitempty"` + // The organization public ID. + PublicId *string `json:"public_id,omitempty"` + // Shows usage aggregation for a billing period. + RatioInMonth *int64 `json:"ratio_in_month,omitempty"` + // Shows the first date of usage. + StartDate *time.Time `json:"start_date,omitempty"` + Usage *UsageBillableSummaryKeys `json:"usage,omitempty"` +} + +// NewUsageBillableSummaryHour instantiates a new UsageBillableSummaryHour object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageBillableSummaryHour() *UsageBillableSummaryHour { + this := UsageBillableSummaryHour{} + return &this +} + +// NewUsageBillableSummaryHourWithDefaults instantiates a new UsageBillableSummaryHour object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageBillableSummaryHourWithDefaults() *UsageBillableSummaryHour { + this := UsageBillableSummaryHour{} + return &this +} + +// GetBillingPlan returns the BillingPlan field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetBillingPlan() string { + if o == nil || o.BillingPlan == nil { + var ret string + return ret + } + return *o.BillingPlan +} + +// GetBillingPlanOk returns a tuple with the BillingPlan field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetBillingPlanOk() (*string, bool) { + if o == nil || o.BillingPlan == nil { + return nil, false + } + return o.BillingPlan, true +} + +// HasBillingPlan returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasBillingPlan() bool { + if o != nil && o.BillingPlan != nil { + return true + } + + return false +} + +// SetBillingPlan gets a reference to the given string and assigns it to the BillingPlan field. +func (o *UsageBillableSummaryHour) SetBillingPlan(v string) { + o.BillingPlan = &v +} + +// GetEndDate returns the EndDate field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetEndDate() time.Time { + if o == nil || o.EndDate == nil { + var ret time.Time + return ret + } + return *o.EndDate +} + +// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetEndDateOk() (*time.Time, bool) { + if o == nil || o.EndDate == nil { + return nil, false + } + return o.EndDate, true +} + +// HasEndDate returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasEndDate() bool { + if o != nil && o.EndDate != nil { + return true + } + + return false +} + +// SetEndDate gets a reference to the given time.Time and assigns it to the EndDate field. +func (o *UsageBillableSummaryHour) SetEndDate(v time.Time) { + o.EndDate = &v +} + +// GetNumOrgs returns the NumOrgs field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetNumOrgs() int64 { + if o == nil || o.NumOrgs == nil { + var ret int64 + return ret + } + return *o.NumOrgs +} + +// GetNumOrgsOk returns a tuple with the NumOrgs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetNumOrgsOk() (*int64, bool) { + if o == nil || o.NumOrgs == nil { + return nil, false + } + return o.NumOrgs, true +} + +// HasNumOrgs returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasNumOrgs() bool { + if o != nil && o.NumOrgs != nil { + return true + } + + return false +} + +// SetNumOrgs gets a reference to the given int64 and assigns it to the NumOrgs field. +func (o *UsageBillableSummaryHour) SetNumOrgs(v int64) { + o.NumOrgs = &v +} + +// GetOrgName returns the OrgName field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetOrgName() string { + if o == nil || o.OrgName == nil { + var ret string + return ret + } + return *o.OrgName +} + +// GetOrgNameOk returns a tuple with the OrgName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetOrgNameOk() (*string, bool) { + if o == nil || o.OrgName == nil { + return nil, false + } + return o.OrgName, true +} + +// HasOrgName returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasOrgName() bool { + if o != nil && o.OrgName != nil { + return true + } + + return false +} + +// SetOrgName gets a reference to the given string and assigns it to the OrgName field. +func (o *UsageBillableSummaryHour) SetOrgName(v string) { + o.OrgName = &v +} + +// GetPublicId returns the PublicId field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetPublicId() string { + if o == nil || o.PublicId == nil { + var ret string + return ret + } + return *o.PublicId +} + +// GetPublicIdOk returns a tuple with the PublicId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetPublicIdOk() (*string, bool) { + if o == nil || o.PublicId == nil { + return nil, false + } + return o.PublicId, true +} + +// HasPublicId returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasPublicId() bool { + if o != nil && o.PublicId != nil { + return true + } + + return false +} + +// SetPublicId gets a reference to the given string and assigns it to the PublicId field. +func (o *UsageBillableSummaryHour) SetPublicId(v string) { + o.PublicId = &v +} + +// GetRatioInMonth returns the RatioInMonth field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetRatioInMonth() int64 { + if o == nil || o.RatioInMonth == nil { + var ret int64 + return ret + } + return *o.RatioInMonth +} + +// GetRatioInMonthOk returns a tuple with the RatioInMonth field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetRatioInMonthOk() (*int64, bool) { + if o == nil || o.RatioInMonth == nil { + return nil, false + } + return o.RatioInMonth, true +} + +// HasRatioInMonth returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasRatioInMonth() bool { + if o != nil && o.RatioInMonth != nil { + return true + } + + return false +} + +// SetRatioInMonth gets a reference to the given int64 and assigns it to the RatioInMonth field. +func (o *UsageBillableSummaryHour) SetRatioInMonth(v int64) { + o.RatioInMonth = &v +} + +// GetStartDate returns the StartDate field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetStartDate() time.Time { + if o == nil || o.StartDate == nil { + var ret time.Time + return ret + } + return *o.StartDate +} + +// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetStartDateOk() (*time.Time, bool) { + if o == nil || o.StartDate == nil { + return nil, false + } + return o.StartDate, true +} + +// HasStartDate returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasStartDate() bool { + if o != nil && o.StartDate != nil { + return true + } + + return false +} + +// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field. +func (o *UsageBillableSummaryHour) SetStartDate(v time.Time) { + o.StartDate = &v +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *UsageBillableSummaryHour) GetUsage() UsageBillableSummaryKeys { + if o == nil || o.Usage == nil { + var ret UsageBillableSummaryKeys + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryHour) GetUsageOk() (*UsageBillableSummaryKeys, bool) { + if o == nil || o.Usage == nil { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *UsageBillableSummaryHour) HasUsage() bool { + if o != nil && o.Usage != nil { + return true + } + + return false +} + +// SetUsage gets a reference to the given UsageBillableSummaryKeys and assigns it to the Usage field. +func (o *UsageBillableSummaryHour) SetUsage(v UsageBillableSummaryKeys) { + o.Usage = &v +} + +func (o UsageBillableSummaryHour) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.BillingPlan != nil { + toSerialize["billing_plan"] = o.BillingPlan + } + if o.EndDate != nil { + toSerialize["end_date"] = o.EndDate + } + if o.NumOrgs != nil { + toSerialize["num_orgs"] = o.NumOrgs + } + if o.OrgName != nil { + toSerialize["org_name"] = o.OrgName + } + if o.PublicId != nil { + toSerialize["public_id"] = o.PublicId + } + if o.RatioInMonth != nil { + toSerialize["ratio_in_month"] = o.RatioInMonth + } + if o.StartDate != nil { + toSerialize["start_date"] = o.StartDate + } + if o.Usage != nil { + toSerialize["usage"] = o.Usage + } + return json.Marshal(toSerialize) +} + +type NullableUsageBillableSummaryHour struct { + value *UsageBillableSummaryHour + isSet bool +} + +func (v NullableUsageBillableSummaryHour) Get() *UsageBillableSummaryHour { + return v.value +} + +func (v *NullableUsageBillableSummaryHour) Set(val *UsageBillableSummaryHour) { + v.value = val + v.isSet = true +} + +func (v NullableUsageBillableSummaryHour) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageBillableSummaryHour) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageBillableSummaryHour(val *UsageBillableSummaryHour) *NullableUsageBillableSummaryHour { + return &NullableUsageBillableSummaryHour{value: val, isSet: true} +} + +func (v NullableUsageBillableSummaryHour) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageBillableSummaryHour) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_usage_billable_summary_keys.go b/api/v1/datadog/model_usage_billable_summary_keys.go new file mode 100644 index 00000000000..14df01bbafb --- /dev/null +++ b/api/v1/datadog/model_usage_billable_summary_keys.go @@ -0,0 +1,723 @@ +/* + * 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. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// UsageBillableSummaryKeys Response with aggregated usage types. +type UsageBillableSummaryKeys struct { + ApmHostSum *UsageBillableSummaryBody `json:"apm_host_sum,omitempty"` + ApmHostTop99p *UsageBillableSummaryBody `json:"apm_host_top99p,omitempty"` + ApmTraceSearchSum *UsageBillableSummaryBody `json:"apm_trace_search_sum,omitempty"` + FargateContainerAverage *UsageBillableSummaryBody `json:"fargate_container_average,omitempty"` + InfraContainerSum *UsageBillableSummaryBody `json:"infra_container_sum,omitempty"` + InfraHostSum *UsageBillableSummaryBody `json:"infra_host_sum,omitempty"` + InfraHostTop99p *UsageBillableSummaryBody `json:"infra_host_top99p,omitempty"` + IotTop99p *UsageBillableSummaryBody `json:"iot_top99p,omitempty"` + LambdaFunctionAverage *UsageBillableSummaryBody `json:"lambda_function_average,omitempty"` + LogsIndexedSum *UsageBillableSummaryBody `json:"logs_indexed_sum,omitempty"` + LogsIngestedSum *UsageBillableSummaryBody `json:"logs_ingested_sum,omitempty"` + NpmFlowSum *UsageBillableSummaryBody `json:"npm_flow_sum,omitempty"` + NpmHostTop99p *UsageBillableSummaryBody `json:"npm_host_top99p,omitempty"` + RumSum *UsageBillableSummaryBody `json:"rum_sum,omitempty"` + SiemSum *UsageBillableSummaryBody `json:"siem_sum,omitempty"` + SyntheticsApiTestsSum *UsageBillableSummaryBody `json:"synthetics_api_tests_sum,omitempty"` + SyntheticsBrowserChecksSum *UsageBillableSummaryBody `json:"synthetics_browser_checks_sum,omitempty"` + TimeseriesAverage *UsageBillableSummaryBody `json:"timeseries_average,omitempty"` +} + +// NewUsageBillableSummaryKeys instantiates a new UsageBillableSummaryKeys object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageBillableSummaryKeys() *UsageBillableSummaryKeys { + this := UsageBillableSummaryKeys{} + return &this +} + +// NewUsageBillableSummaryKeysWithDefaults instantiates a new UsageBillableSummaryKeys object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageBillableSummaryKeysWithDefaults() *UsageBillableSummaryKeys { + this := UsageBillableSummaryKeys{} + return &this +} + +// GetApmHostSum returns the ApmHostSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetApmHostSum() UsageBillableSummaryBody { + if o == nil || o.ApmHostSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.ApmHostSum +} + +// GetApmHostSumOk returns a tuple with the ApmHostSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetApmHostSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.ApmHostSum == nil { + return nil, false + } + return o.ApmHostSum, true +} + +// HasApmHostSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasApmHostSum() bool { + if o != nil && o.ApmHostSum != nil { + return true + } + + return false +} + +// SetApmHostSum gets a reference to the given UsageBillableSummaryBody and assigns it to the ApmHostSum field. +func (o *UsageBillableSummaryKeys) SetApmHostSum(v UsageBillableSummaryBody) { + o.ApmHostSum = &v +} + +// GetApmHostTop99p returns the ApmHostTop99p field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetApmHostTop99p() UsageBillableSummaryBody { + if o == nil || o.ApmHostTop99p == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.ApmHostTop99p +} + +// GetApmHostTop99pOk returns a tuple with the ApmHostTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetApmHostTop99pOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.ApmHostTop99p == nil { + return nil, false + } + return o.ApmHostTop99p, true +} + +// HasApmHostTop99p returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasApmHostTop99p() bool { + if o != nil && o.ApmHostTop99p != nil { + return true + } + + return false +} + +// SetApmHostTop99p gets a reference to the given UsageBillableSummaryBody and assigns it to the ApmHostTop99p field. +func (o *UsageBillableSummaryKeys) SetApmHostTop99p(v UsageBillableSummaryBody) { + o.ApmHostTop99p = &v +} + +// GetApmTraceSearchSum returns the ApmTraceSearchSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetApmTraceSearchSum() UsageBillableSummaryBody { + if o == nil || o.ApmTraceSearchSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.ApmTraceSearchSum +} + +// GetApmTraceSearchSumOk returns a tuple with the ApmTraceSearchSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetApmTraceSearchSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.ApmTraceSearchSum == nil { + return nil, false + } + return o.ApmTraceSearchSum, true +} + +// HasApmTraceSearchSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasApmTraceSearchSum() bool { + if o != nil && o.ApmTraceSearchSum != nil { + return true + } + + return false +} + +// SetApmTraceSearchSum gets a reference to the given UsageBillableSummaryBody and assigns it to the ApmTraceSearchSum field. +func (o *UsageBillableSummaryKeys) SetApmTraceSearchSum(v UsageBillableSummaryBody) { + o.ApmTraceSearchSum = &v +} + +// GetFargateContainerAverage returns the FargateContainerAverage field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetFargateContainerAverage() UsageBillableSummaryBody { + if o == nil || o.FargateContainerAverage == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.FargateContainerAverage +} + +// GetFargateContainerAverageOk returns a tuple with the FargateContainerAverage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetFargateContainerAverageOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.FargateContainerAverage == nil { + return nil, false + } + return o.FargateContainerAverage, true +} + +// HasFargateContainerAverage returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasFargateContainerAverage() bool { + if o != nil && o.FargateContainerAverage != nil { + return true + } + + return false +} + +// SetFargateContainerAverage gets a reference to the given UsageBillableSummaryBody and assigns it to the FargateContainerAverage field. +func (o *UsageBillableSummaryKeys) SetFargateContainerAverage(v UsageBillableSummaryBody) { + o.FargateContainerAverage = &v +} + +// GetInfraContainerSum returns the InfraContainerSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetInfraContainerSum() UsageBillableSummaryBody { + if o == nil || o.InfraContainerSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.InfraContainerSum +} + +// GetInfraContainerSumOk returns a tuple with the InfraContainerSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetInfraContainerSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.InfraContainerSum == nil { + return nil, false + } + return o.InfraContainerSum, true +} + +// HasInfraContainerSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasInfraContainerSum() bool { + if o != nil && o.InfraContainerSum != nil { + return true + } + + return false +} + +// SetInfraContainerSum gets a reference to the given UsageBillableSummaryBody and assigns it to the InfraContainerSum field. +func (o *UsageBillableSummaryKeys) SetInfraContainerSum(v UsageBillableSummaryBody) { + o.InfraContainerSum = &v +} + +// GetInfraHostSum returns the InfraHostSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetInfraHostSum() UsageBillableSummaryBody { + if o == nil || o.InfraHostSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.InfraHostSum +} + +// GetInfraHostSumOk returns a tuple with the InfraHostSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetInfraHostSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.InfraHostSum == nil { + return nil, false + } + return o.InfraHostSum, true +} + +// HasInfraHostSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasInfraHostSum() bool { + if o != nil && o.InfraHostSum != nil { + return true + } + + return false +} + +// SetInfraHostSum gets a reference to the given UsageBillableSummaryBody and assigns it to the InfraHostSum field. +func (o *UsageBillableSummaryKeys) SetInfraHostSum(v UsageBillableSummaryBody) { + o.InfraHostSum = &v +} + +// GetInfraHostTop99p returns the InfraHostTop99p field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetInfraHostTop99p() UsageBillableSummaryBody { + if o == nil || o.InfraHostTop99p == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.InfraHostTop99p +} + +// GetInfraHostTop99pOk returns a tuple with the InfraHostTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetInfraHostTop99pOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.InfraHostTop99p == nil { + return nil, false + } + return o.InfraHostTop99p, true +} + +// HasInfraHostTop99p returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasInfraHostTop99p() bool { + if o != nil && o.InfraHostTop99p != nil { + return true + } + + return false +} + +// SetInfraHostTop99p gets a reference to the given UsageBillableSummaryBody and assigns it to the InfraHostTop99p field. +func (o *UsageBillableSummaryKeys) SetInfraHostTop99p(v UsageBillableSummaryBody) { + o.InfraHostTop99p = &v +} + +// GetIotTop99p returns the IotTop99p field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetIotTop99p() UsageBillableSummaryBody { + if o == nil || o.IotTop99p == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.IotTop99p +} + +// GetIotTop99pOk returns a tuple with the IotTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetIotTop99pOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.IotTop99p == nil { + return nil, false + } + return o.IotTop99p, true +} + +// HasIotTop99p returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasIotTop99p() bool { + if o != nil && o.IotTop99p != nil { + return true + } + + return false +} + +// SetIotTop99p gets a reference to the given UsageBillableSummaryBody and assigns it to the IotTop99p field. +func (o *UsageBillableSummaryKeys) SetIotTop99p(v UsageBillableSummaryBody) { + o.IotTop99p = &v +} + +// GetLambdaFunctionAverage returns the LambdaFunctionAverage field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetLambdaFunctionAverage() UsageBillableSummaryBody { + if o == nil || o.LambdaFunctionAverage == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.LambdaFunctionAverage +} + +// GetLambdaFunctionAverageOk returns a tuple with the LambdaFunctionAverage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetLambdaFunctionAverageOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.LambdaFunctionAverage == nil { + return nil, false + } + return o.LambdaFunctionAverage, true +} + +// HasLambdaFunctionAverage returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasLambdaFunctionAverage() bool { + if o != nil && o.LambdaFunctionAverage != nil { + return true + } + + return false +} + +// SetLambdaFunctionAverage gets a reference to the given UsageBillableSummaryBody and assigns it to the LambdaFunctionAverage field. +func (o *UsageBillableSummaryKeys) SetLambdaFunctionAverage(v UsageBillableSummaryBody) { + o.LambdaFunctionAverage = &v +} + +// GetLogsIndexedSum returns the LogsIndexedSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetLogsIndexedSum() UsageBillableSummaryBody { + if o == nil || o.LogsIndexedSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.LogsIndexedSum +} + +// GetLogsIndexedSumOk returns a tuple with the LogsIndexedSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetLogsIndexedSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.LogsIndexedSum == nil { + return nil, false + } + return o.LogsIndexedSum, true +} + +// HasLogsIndexedSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasLogsIndexedSum() bool { + if o != nil && o.LogsIndexedSum != nil { + return true + } + + return false +} + +// SetLogsIndexedSum gets a reference to the given UsageBillableSummaryBody and assigns it to the LogsIndexedSum field. +func (o *UsageBillableSummaryKeys) SetLogsIndexedSum(v UsageBillableSummaryBody) { + o.LogsIndexedSum = &v +} + +// GetLogsIngestedSum returns the LogsIngestedSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetLogsIngestedSum() UsageBillableSummaryBody { + if o == nil || o.LogsIngestedSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.LogsIngestedSum +} + +// GetLogsIngestedSumOk returns a tuple with the LogsIngestedSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetLogsIngestedSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.LogsIngestedSum == nil { + return nil, false + } + return o.LogsIngestedSum, true +} + +// HasLogsIngestedSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasLogsIngestedSum() bool { + if o != nil && o.LogsIngestedSum != nil { + return true + } + + return false +} + +// SetLogsIngestedSum gets a reference to the given UsageBillableSummaryBody and assigns it to the LogsIngestedSum field. +func (o *UsageBillableSummaryKeys) SetLogsIngestedSum(v UsageBillableSummaryBody) { + o.LogsIngestedSum = &v +} + +// GetNpmFlowSum returns the NpmFlowSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetNpmFlowSum() UsageBillableSummaryBody { + if o == nil || o.NpmFlowSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.NpmFlowSum +} + +// GetNpmFlowSumOk returns a tuple with the NpmFlowSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetNpmFlowSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.NpmFlowSum == nil { + return nil, false + } + return o.NpmFlowSum, true +} + +// HasNpmFlowSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasNpmFlowSum() bool { + if o != nil && o.NpmFlowSum != nil { + return true + } + + return false +} + +// SetNpmFlowSum gets a reference to the given UsageBillableSummaryBody and assigns it to the NpmFlowSum field. +func (o *UsageBillableSummaryKeys) SetNpmFlowSum(v UsageBillableSummaryBody) { + o.NpmFlowSum = &v +} + +// GetNpmHostTop99p returns the NpmHostTop99p field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetNpmHostTop99p() UsageBillableSummaryBody { + if o == nil || o.NpmHostTop99p == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.NpmHostTop99p +} + +// GetNpmHostTop99pOk returns a tuple with the NpmHostTop99p field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetNpmHostTop99pOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.NpmHostTop99p == nil { + return nil, false + } + return o.NpmHostTop99p, true +} + +// HasNpmHostTop99p returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasNpmHostTop99p() bool { + if o != nil && o.NpmHostTop99p != nil { + return true + } + + return false +} + +// SetNpmHostTop99p gets a reference to the given UsageBillableSummaryBody and assigns it to the NpmHostTop99p field. +func (o *UsageBillableSummaryKeys) SetNpmHostTop99p(v UsageBillableSummaryBody) { + o.NpmHostTop99p = &v +} + +// GetRumSum returns the RumSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetRumSum() UsageBillableSummaryBody { + if o == nil || o.RumSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.RumSum +} + +// GetRumSumOk returns a tuple with the RumSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetRumSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.RumSum == nil { + return nil, false + } + return o.RumSum, true +} + +// HasRumSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasRumSum() bool { + if o != nil && o.RumSum != nil { + return true + } + + return false +} + +// SetRumSum gets a reference to the given UsageBillableSummaryBody and assigns it to the RumSum field. +func (o *UsageBillableSummaryKeys) SetRumSum(v UsageBillableSummaryBody) { + o.RumSum = &v +} + +// GetSiemSum returns the SiemSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetSiemSum() UsageBillableSummaryBody { + if o == nil || o.SiemSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.SiemSum +} + +// GetSiemSumOk returns a tuple with the SiemSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetSiemSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.SiemSum == nil { + return nil, false + } + return o.SiemSum, true +} + +// HasSiemSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasSiemSum() bool { + if o != nil && o.SiemSum != nil { + return true + } + + return false +} + +// SetSiemSum gets a reference to the given UsageBillableSummaryBody and assigns it to the SiemSum field. +func (o *UsageBillableSummaryKeys) SetSiemSum(v UsageBillableSummaryBody) { + o.SiemSum = &v +} + +// GetSyntheticsApiTestsSum returns the SyntheticsApiTestsSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetSyntheticsApiTestsSum() UsageBillableSummaryBody { + if o == nil || o.SyntheticsApiTestsSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.SyntheticsApiTestsSum +} + +// GetSyntheticsApiTestsSumOk returns a tuple with the SyntheticsApiTestsSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetSyntheticsApiTestsSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.SyntheticsApiTestsSum == nil { + return nil, false + } + return o.SyntheticsApiTestsSum, true +} + +// HasSyntheticsApiTestsSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasSyntheticsApiTestsSum() bool { + if o != nil && o.SyntheticsApiTestsSum != nil { + return true + } + + return false +} + +// SetSyntheticsApiTestsSum gets a reference to the given UsageBillableSummaryBody and assigns it to the SyntheticsApiTestsSum field. +func (o *UsageBillableSummaryKeys) SetSyntheticsApiTestsSum(v UsageBillableSummaryBody) { + o.SyntheticsApiTestsSum = &v +} + +// GetSyntheticsBrowserChecksSum returns the SyntheticsBrowserChecksSum field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetSyntheticsBrowserChecksSum() UsageBillableSummaryBody { + if o == nil || o.SyntheticsBrowserChecksSum == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.SyntheticsBrowserChecksSum +} + +// GetSyntheticsBrowserChecksSumOk returns a tuple with the SyntheticsBrowserChecksSum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetSyntheticsBrowserChecksSumOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.SyntheticsBrowserChecksSum == nil { + return nil, false + } + return o.SyntheticsBrowserChecksSum, true +} + +// HasSyntheticsBrowserChecksSum returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasSyntheticsBrowserChecksSum() bool { + if o != nil && o.SyntheticsBrowserChecksSum != nil { + return true + } + + return false +} + +// SetSyntheticsBrowserChecksSum gets a reference to the given UsageBillableSummaryBody and assigns it to the SyntheticsBrowserChecksSum field. +func (o *UsageBillableSummaryKeys) SetSyntheticsBrowserChecksSum(v UsageBillableSummaryBody) { + o.SyntheticsBrowserChecksSum = &v +} + +// GetTimeseriesAverage returns the TimeseriesAverage field value if set, zero value otherwise. +func (o *UsageBillableSummaryKeys) GetTimeseriesAverage() UsageBillableSummaryBody { + if o == nil || o.TimeseriesAverage == nil { + var ret UsageBillableSummaryBody + return ret + } + return *o.TimeseriesAverage +} + +// GetTimeseriesAverageOk returns a tuple with the TimeseriesAverage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryKeys) GetTimeseriesAverageOk() (*UsageBillableSummaryBody, bool) { + if o == nil || o.TimeseriesAverage == nil { + return nil, false + } + return o.TimeseriesAverage, true +} + +// HasTimeseriesAverage returns a boolean if a field has been set. +func (o *UsageBillableSummaryKeys) HasTimeseriesAverage() bool { + if o != nil && o.TimeseriesAverage != nil { + return true + } + + return false +} + +// SetTimeseriesAverage gets a reference to the given UsageBillableSummaryBody and assigns it to the TimeseriesAverage field. +func (o *UsageBillableSummaryKeys) SetTimeseriesAverage(v UsageBillableSummaryBody) { + o.TimeseriesAverage = &v +} + +func (o UsageBillableSummaryKeys) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ApmHostSum != nil { + toSerialize["apm_host_sum"] = o.ApmHostSum + } + if o.ApmHostTop99p != nil { + toSerialize["apm_host_top99p"] = o.ApmHostTop99p + } + if o.ApmTraceSearchSum != nil { + toSerialize["apm_trace_search_sum"] = o.ApmTraceSearchSum + } + if o.FargateContainerAverage != nil { + toSerialize["fargate_container_average"] = o.FargateContainerAverage + } + if o.InfraContainerSum != nil { + toSerialize["infra_container_sum"] = o.InfraContainerSum + } + if o.InfraHostSum != nil { + toSerialize["infra_host_sum"] = o.InfraHostSum + } + if o.InfraHostTop99p != nil { + toSerialize["infra_host_top99p"] = o.InfraHostTop99p + } + if o.IotTop99p != nil { + toSerialize["iot_top99p"] = o.IotTop99p + } + if o.LambdaFunctionAverage != nil { + toSerialize["lambda_function_average"] = o.LambdaFunctionAverage + } + if o.LogsIndexedSum != nil { + toSerialize["logs_indexed_sum"] = o.LogsIndexedSum + } + if o.LogsIngestedSum != nil { + toSerialize["logs_ingested_sum"] = o.LogsIngestedSum + } + if o.NpmFlowSum != nil { + toSerialize["npm_flow_sum"] = o.NpmFlowSum + } + if o.NpmHostTop99p != nil { + toSerialize["npm_host_top99p"] = o.NpmHostTop99p + } + if o.RumSum != nil { + toSerialize["rum_sum"] = o.RumSum + } + if o.SiemSum != nil { + toSerialize["siem_sum"] = o.SiemSum + } + if o.SyntheticsApiTestsSum != nil { + toSerialize["synthetics_api_tests_sum"] = o.SyntheticsApiTestsSum + } + if o.SyntheticsBrowserChecksSum != nil { + toSerialize["synthetics_browser_checks_sum"] = o.SyntheticsBrowserChecksSum + } + if o.TimeseriesAverage != nil { + toSerialize["timeseries_average"] = o.TimeseriesAverage + } + return json.Marshal(toSerialize) +} + +type NullableUsageBillableSummaryKeys struct { + value *UsageBillableSummaryKeys + isSet bool +} + +func (v NullableUsageBillableSummaryKeys) Get() *UsageBillableSummaryKeys { + return v.value +} + +func (v *NullableUsageBillableSummaryKeys) Set(val *UsageBillableSummaryKeys) { + v.value = val + v.isSet = true +} + +func (v NullableUsageBillableSummaryKeys) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageBillableSummaryKeys) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageBillableSummaryKeys(val *UsageBillableSummaryKeys) *NullableUsageBillableSummaryKeys { + return &NullableUsageBillableSummaryKeys{value: val, isSet: true} +} + +func (v NullableUsageBillableSummaryKeys) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageBillableSummaryKeys) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/api/v1/datadog/model_usage_billable_summary_response.go b/api/v1/datadog/model_usage_billable_summary_response.go new file mode 100644 index 00000000000..587692ede80 --- /dev/null +++ b/api/v1/datadog/model_usage_billable_summary_response.go @@ -0,0 +1,112 @@ +/* + * 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. + */ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package datadog + +import ( + "encoding/json" +) + +// UsageBillableSummaryResponse Response with monthly summary of data billed by Datadog. +type UsageBillableSummaryResponse struct { + // An array of objects regarding usage of billable summary. + Usage *[]UsageBillableSummaryHour `json:"usage,omitempty"` +} + +// NewUsageBillableSummaryResponse instantiates a new UsageBillableSummaryResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUsageBillableSummaryResponse() *UsageBillableSummaryResponse { + this := UsageBillableSummaryResponse{} + return &this +} + +// NewUsageBillableSummaryResponseWithDefaults instantiates a new UsageBillableSummaryResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUsageBillableSummaryResponseWithDefaults() *UsageBillableSummaryResponse { + this := UsageBillableSummaryResponse{} + return &this +} + +// GetUsage returns the Usage field value if set, zero value otherwise. +func (o *UsageBillableSummaryResponse) GetUsage() []UsageBillableSummaryHour { + if o == nil || o.Usage == nil { + var ret []UsageBillableSummaryHour + return ret + } + return *o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UsageBillableSummaryResponse) GetUsageOk() (*[]UsageBillableSummaryHour, bool) { + if o == nil || o.Usage == nil { + return nil, false + } + return o.Usage, true +} + +// HasUsage returns a boolean if a field has been set. +func (o *UsageBillableSummaryResponse) HasUsage() bool { + if o != nil && o.Usage != nil { + return true + } + + return false +} + +// SetUsage gets a reference to the given []UsageBillableSummaryHour and assigns it to the Usage field. +func (o *UsageBillableSummaryResponse) SetUsage(v []UsageBillableSummaryHour) { + o.Usage = &v +} + +func (o UsageBillableSummaryResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Usage != nil { + toSerialize["usage"] = o.Usage + } + return json.Marshal(toSerialize) +} + +type NullableUsageBillableSummaryResponse struct { + value *UsageBillableSummaryResponse + isSet bool +} + +func (v NullableUsageBillableSummaryResponse) Get() *UsageBillableSummaryResponse { + return v.value +} + +func (v *NullableUsageBillableSummaryResponse) Set(val *UsageBillableSummaryResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUsageBillableSummaryResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUsageBillableSummaryResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUsageBillableSummaryResponse(val *UsageBillableSummaryResponse) *NullableUsageBillableSummaryResponse { + return &NullableUsageBillableSummaryResponse{value: val, isSet: true} +} + +func (v NullableUsageBillableSummaryResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUsageBillableSummaryResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/tests/api/v1/datadog/api_usage_metering_test.go b/tests/api/v1/datadog/api_usage_metering_test.go index a66330c7180..e57bf348312 100644 --- a/tests/api/v1/datadog/api_usage_metering_test.go +++ b/tests/api/v1/datadog/api_usage_metering_test.go @@ -259,6 +259,63 @@ func TestUsageSNMP(t *testing.T) { assert.True(usage.HasUsage()) } +func TestUsageBillableSummary(t *testing.T) { + ctx, finish := WithClient(WithFakeAuth(context.Background()), t) + defer finish() + assert := tests.Assert(ctx, t) + + // startMonth := time.Date(2020, 06, 01, 0, 0, 0, 0, time.UTC) + // endMonth := time.Date(2020, 06, 28, 23, 0, 0, 0, time.UTC) + + fixturePath, err := filepath.Abs("fixtures/usage/usage_billable_summary.json") + if err != nil { + t.Errorf("Failed to get fixture file path: %s", err) + } + data, err := ioutil.ReadFile(fixturePath) + if err != nil { + t.Errorf("Failed to open fixture file: %s", err) + } + + // The query params get normalized via autogenerated code, so just confirm that the keys exist in the request + URL, err := Client(ctx).GetConfig().ServerURLWithContext(ctx, "UsageMeteringApiService.GetUsageBillableSummary") + assert.NoError(err) + gock.New(URL). + Get("/api/v1/usage/billable-summary"). + Reply(200). + JSON(data) + defer gock.Off() + + var expected datadog.UsageBillableSummaryResponse + json.Unmarshal([]byte(data), &expected) + + api := Client(ctx).UsageMeteringApi + usage, httpresp, err := api.GetUsageBillableSummary(ctx).Execute() + if err != nil { + t.Errorf("Failed to get Billable Usage Summary: %v", err) + } + + assert.Equal(200, httpresp.StatusCode) + var usageItem = usage.GetUsage()[0] + assert.Equal("API - Test", usageItem.GetOrgName()) + assert.Equal("Pro", usageItem.GetBillingPlan()) + assert.Equal("123abcxyz", usageItem.GetPublicId()) + assert.Equal(time.Date(2020, 06, 01, 00, 0, 0, 0, time.UTC), usageItem.GetStartDate().UTC()) + assert.Equal(time.Date(2020, 06, 28, 23, 0, 0, 0, time.UTC), usageItem.GetEndDate().UTC()) + assert.Equal(int64(1), usageItem.GetRatioInMonth()) + assert.Equal(int64(235), usageItem.GetNumOrgs()) + + var usageUsageItem = usageItem.GetUsage() + var usageKeys = usageUsageItem.GetLogsIndexedSum() + + assert.Equal(int64(14514687), usageKeys.GetOrgBillableUsage()) + assert.Equal("logs", usageKeys.GetUsageUnit()) + assert.Equal(int64(1611132837), usageKeys.GetAccountBillableUsage()) + assert.Equal(time.Date(2020, 06, 01, 0, 0, 0, 0, time.UTC), usageKeys.GetFirstBillableUsageHour().UTC()) + assert.Equal(int64(672), usageKeys.GetElapsedUsageHours()) + assert.Equal(time.Date(2020, 06, 28, 23, 0, 0, 0, time.UTC), usageKeys.GetLastBillableUsageHour().UTC()) + assert.Equal(float64(0.9), usageKeys.GetPercentageInAccount()) +} + // This test needs multi-org token so make it a unit test func TestUsageSummary(t *testing.T) { ctx, finish := WithClient(WithFakeAuth(context.Background()), t) @@ -466,6 +523,56 @@ func TestUsageGetSNMPErrors(t *testing.T) { } } +func TestUsageGetBillableSummaryErrors(t *testing.T) { + ctx, close := tests.WithTestSpan(context.Background(), t) + defer close() + + testCases := map[string]struct { + Ctx func(context.Context) context.Context + ExpectedStatusCode int + }{ + //"400 Bad Request": {WithTestAuth, 400}, + "403 Forbidden": {WithFakeAuth, 403}, + } + + for name, tc := range testCases { + t.Run(name, func(t *testing.T) { + ctx, finish := WithRecorder(tc.Ctx(ctx), t) + defer finish() + assert := tests.Assert(ctx, t) + + _, httpresp, err := Client(ctx).UsageMeteringApi.GetUsageBillableSummary(ctx).Execute() + assert.Equal(tc.ExpectedStatusCode, httpresp.StatusCode) + apiError, ok := err.(datadog.GenericOpenAPIError).Model().(datadog.APIErrorResponse) + assert.True(ok) + assert.NotEmpty(apiError.GetErrors()) + }) + } +} + +func TestUsageGetBillableSummary400Error(t *testing.T) { + ctx, finish := WithClient(WithFakeAuth(context.Background()), t) + defer finish() + assert := tests.Assert(ctx, t) + + res, err := tests.ReadFixture("fixtures/usage/error_400.json") + if err != nil { + t.Fatalf("Failed to read fixture: %s", err) + } + // Mocked as this call must be made from the parent organization + URL, err := Client(ctx).GetConfig().ServerURLWithContext(ctx, "") + assert.NoError(err) + gock.New(URL).Get("/api/v1/usage/billable-summary").Reply(400).JSON(res) + defer gock.Off() + + // 400 Bad Request + _, httpresp, err := Client(ctx).UsageMeteringApi.GetUsageBillableSummary(ctx).Execute() + assert.Equal(400, httpresp.StatusCode) + apiError, ok := err.(datadog.GenericOpenAPIError).Model().(datadog.APIErrorResponse) + assert.True(ok) + assert.NotEmpty(apiError.GetErrors()) +} + func TestUsageTimeSeriesErrors(t *testing.T) { ctx, close := tests.WithTestSpan(context.Background(), t) defer close() diff --git a/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.freeze b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.freeze new file mode 100644 index 00000000000..8df6c2869fa --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.freeze @@ -0,0 +1 @@ +2020-07-01T20:02:54.869688-03:00 \ No newline at end of file diff --git a/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.yaml b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.yaml new file mode 100644 index 00000000000..ee80efc1417 --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/400_Bad_Request.yaml @@ -0,0 +1,38 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json;datetime-format=rfc3339 + Dd-Operation-Id: + - GetUsageBillableSummary + User-Agent: + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "5300438898491668293" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "6547610753570398397" + url: https://api.datadoghq.com/api/v1/usage/billable-summary?start_date=2020-08-01T20%3A02%3A54-03%3A00 + method: GET + response: + body: | + {"status":"error","code":403,"errors":["Forbidden"],"statuspage":"http://status.datadoghq.com","twitter":"http://twitter.com/datadogops","email":"support@datadoghq.com"} + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Wed, 01 Jul 2020 23:02:54 GMT + Via: + - 1.1 haproxy + status: 403 Forbidden + code: 403 + duration: "" diff --git a/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.freeze b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.freeze new file mode 100644 index 00000000000..c60e96439c2 --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.freeze @@ -0,0 +1 @@ +2020-07-02T17:28:52.366686-03:00 \ No newline at end of file diff --git a/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.yaml b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.yaml new file mode 100644 index 00000000000..51b941dbbe6 --- /dev/null +++ b/tests/api/v1/datadog/cassettes/TestUsageGetBillableSummaryErrors/403_Forbidden.yaml @@ -0,0 +1,38 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json;datetime-format=rfc3339 + Dd-Operation-Id: + - GetUsageBillableSummary + User-Agent: + - datadog-api-client-go/1.0.0-beta.7+dev (go go1.14.3; os darwin; arch amd64) + X-Datadog-Parent-Id: + - "5713706134213849848" + X-Datadog-Sampling-Priority: + - "1" + X-Datadog-Trace-Id: + - "1342228246921730675" + url: https://api.datadoghq.com/api/v1/usage/billable-summary + method: GET + response: + body: | + {"status":"error","code":403,"errors":["Forbidden"],"statuspage":"http://status.datadoghq.com","twitter":"http://twitter.com/datadogops","email":"support@datadoghq.com"} + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Type: + - application/json + Date: + - Thu, 02 Jul 2020 20:28:53 GMT + Via: + - 1.1 haproxy + status: 403 Forbidden + code: 403 + duration: "" diff --git a/tests/api/v1/datadog/fixtures/usage/usage_billable_summary.json b/tests/api/v1/datadog/fixtures/usage/usage_billable_summary.json new file mode 100644 index 00000000000..c4b0afcc584 --- /dev/null +++ b/tests/api/v1/datadog/fixtures/usage/usage_billable_summary.json @@ -0,0 +1,170 @@ +{ + "usage": + [ + { + "org_name": "API - Test", + "billing_plan": "Pro", + "public_id": "123abcxyz", + "start_date": "2020-06-01T00:00:00+00:00", + "end_date": "2020-06-28T23:00:00+00:00", + "ratio_in_month": 1, + "num_orgs": 235, + "usage": { + "apm_host_top99p": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "apm_trace_search_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "fargate_container_avg": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "infra_container_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "infra_host_top99p": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "infra_host_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "iot_top99p": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "lambda_function_avg": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "logs_indexed_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "logs_ingested_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "npm_host_top99p": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "npm_flow_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "rum_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "siem_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "synthetics_api_tests_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "synthetics_browser_checks_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + }, + "timeseries_sum": { + "org_billable_usage": 14514687, + "usage_unit": "logs", + "account_billable_usage": 1611132837, + "first_billable_usage_hour": "2020-06-01T00:00:00+00:00", + "elapsed_usage_hours": 672, + "last_billable_usage_hour": "2020-06-28T23:00:00+00:00", + "percentage_in_account": 0.9 + } + } + } + ] + } + \ No newline at end of file