Skip to content

Commit

Permalink
Regenerate client from commit af3f11fc of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Nov 4, 2022
1 parent 92a9c3e commit 60cdb37
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-11-02 20:10:47.186007",
"spec_repo_commit": "7c5579df"
"regenerated": "2022-11-04 18:42:25.256115",
"spec_repo_commit": "af3f11fc"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-11-02 20:10:47.202972",
"spec_repo_commit": "7c5579df"
"regenerated": "2022-11-04 18:42:25.269568",
"spec_repo_commit": "af3f11fc"
}
}
}
4 changes: 3 additions & 1 deletion .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16461,7 +16461,9 @@ paths:
get:
description: 'Get estimated cost across multi-org and single root-org accounts.

Estimated cost data is only available for the current month and previous month.
Estimated cost data is only available for the current month and previous month

and is delayed by up to 72 hours from when it was incurred.

To access historical costs prior to this, use the `/historical_cost` endpoint.'
operationId: GetEstimatedCostByOrg
Expand Down
3 changes: 2 additions & 1 deletion api/datadogV2/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ func (a *UsageMeteringApi) buildGetEstimatedCostByOrgRequest(ctx _context.Contex

// GetEstimatedCostByOrg Get estimated cost across your account.
// Get estimated cost across multi-org and single root-org accounts.
// Estimated cost data is only available for the current month and previous month.
// Estimated cost data is only available for the current month and previous month
// and is delayed by up to 72 hours from when it was incurred.
// To access historical costs prior to this, use the `/historical_cost` endpoint.
func (a *UsageMeteringApi) GetEstimatedCostByOrg(ctx _context.Context, o ...GetEstimatedCostByOrgOptionalParameters) (CostByOrgResponse, *_nethttp.Response, error) {
req, err := a.buildGetEstimatedCostByOrgRequest(ctx, o...)
Expand Down
30 changes: 0 additions & 30 deletions examples/v2/usage-metering/GetEstimatedCostByOrg_2734954020.go

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func main() {
configuration := datadog.NewConfiguration()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewUsageMeteringApi(apiClient)
resp, r, err := api.GetEstimatedCostByOrg(ctx, *datadogV2.NewGetEstimatedCostByOrgOptionalParameters().WithView("sub-org").WithStartMonth(time.Now().AddDate(0, 0, -5)))
resp, r, err := api.GetEstimatedCostByOrg(ctx, *datadogV2.NewGetEstimatedCostByOrgOptionalParameters().WithView("sub-org").WithStartMonth(time.Now()))

if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `UsageMeteringApi.GetEstimatedCostByOrg`: %v\n", err)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-09-23T14:04:15.545Z
2022-11-03T21:08:41.229Z
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interactions:
Accept:
- application/json;datetime-format=rfc3339
method: GET
url: https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-09-20T14%3A04%3A15.545Z&start_date=2022-09-20T14%3A04%3A15.545Z
url: https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-11-03T21%3A08%3A41.229Z&start_date=2022-10-31T21%3A08%3A41.229Z
response:
body: '{"errors":["API called with non-parent org keys. Data is only available
at the root level org"]}'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2022-11-04T18:40:14.021Z
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
interactions:
- request:
body: ''
form: {}
headers:
Accept:
- application/json;datetime-format=rfc3339
method: GET
url: https://api.datadoghq.com/api/v2/usage/estimated_cost?view=sub-org&start_month=2022-11-04T18%3A40%3A14.021Z
response:
body: '{"data":[]}
'
code: 200
duration: ''
headers:
Content-Type:
- application/json
status: 200 OK
version: 1
12 changes: 2 additions & 10 deletions tests/scenarios/features/v2/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -166,23 +166,15 @@ Feature: Usage Metering
Scenario: GetEstimatedCostByOrg with both start_month and start_date returns "Bad Request" response
Given new "GetEstimatedCostByOrg" request
And request contains "view" parameter with value "sub-org"
And request contains "start_month" parameter with value "{{ timeISO('now - 3d') }}"
And request contains "start_month" parameter with value "{{ timeISO('now') }}"
And request contains "start_date" parameter with value "{{ timeISO('now - 3d') }}"
When the request is sent
Then the response status is 400 Bad Request

@replay-only @team:DataDog/red-zone-revenue-query
Scenario: GetEstimatedCostByOrg with start_date returns "OK" response
Given new "GetEstimatedCostByOrg" request
And request contains "view" parameter with value "sub-org"
And request contains "start_date" parameter with value "{{ timeISO('now - 5d') }}"
When the request is sent
Then the response status is 200 OK

@skip @team:DataDog/red-zone-revenue-query
Scenario: GetEstimatedCostByOrg with start_month returns "OK" response
Given new "GetEstimatedCostByOrg" request
And request contains "view" parameter with value "sub-org"
And request contains "start_month" parameter with value "{{ timeISO('now - 5d') }}"
And request contains "start_month" parameter with value "{{ timeISO('now') }}"
When the request is sent
Then the response status is 200 OK

0 comments on commit 60cdb37

Please sign in to comment.