Skip to content

Commit 1b842de

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Make sure required params are first (#2777)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent c2a5dd9 commit 1b842de

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "4413e63",
3-
"generated": "2025-08-19 20:28:38.330"
2+
"spec_repo_commit": "d58cb84",
3+
"generated": "2025-08-22 18:45:21.021"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67451,14 +67451,6 @@ paths:
6745167451
This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
6745267452
operationId: GetHistoricalCostByOrg
6745367453
parameters:
67454-
- description: String to specify whether cost is broken down at a parent-org
67455-
level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults
67456-
to `summary`.
67457-
in: query
67458-
name: view
67459-
required: false
67460-
schema:
67461-
type: string
6746267454
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
6746367455
for cost beginning this month.'
6746467456
in: query
@@ -67467,6 +67459,14 @@ paths:
6746767459
schema:
6746867460
format: date-time
6746967461
type: string
67462+
- description: String to specify whether cost is broken down at a parent-org
67463+
level or at the sub-org level. Available views are `summary` and `sub-org`. Defaults
67464+
to `summary`.
67465+
in: query
67466+
name: view
67467+
required: false
67468+
schema:
67469+
type: string
6747067470
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
6747167471
for cost ending this month.'
6747267472
in: query

examples/v2/usage-metering/GetHistoricalCostByOrg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
with ApiClient(configuration) as api_client:
1212
api_instance = UsageMeteringApi(api_client)
1313
response = api_instance.get_historical_cost_by_org(
14-
view="sub-org",
1514
start_month=(datetime.now() + relativedelta(months=-2)),
15+
view="sub-org",
1616
)
1717

1818
print(response)

src/datadog_api_client/v2/api/usage_metering_api.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ def __init__(self, api_client=None):
174174
"version": "v2",
175175
},
176176
params_map={
177-
"view": {
178-
"openapi_types": (str,),
179-
"attribute": "view",
180-
"location": "query",
181-
},
182177
"start_month": {
183178
"required": True,
184179
"openapi_types": (datetime,),
185180
"attribute": "start_month",
186181
"location": "query",
187182
},
183+
"view": {
184+
"openapi_types": (str,),
185+
"attribute": "view",
186+
"location": "query",
187+
},
188188
"end_month": {
189189
"openapi_types": (datetime,),
190190
"attribute": "end_month",
@@ -591,11 +591,11 @@ def get_historical_cost_by_org(
591591
:rtype: CostByOrgResponse
592592
"""
593593
kwargs: Dict[str, Any] = {}
594+
kwargs["start_month"] = start_month
595+
594596
if view is not unset:
595597
kwargs["view"] = view
596598

597-
kwargs["start_month"] = start_month
598-
599599
if end_month is not unset:
600600
kwargs["end_month"] = end_month
601601

0 commit comments

Comments
 (0)