Skip to content

Commit 7ec2128

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 452360f of spec repo (#321)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e4caf6e commit 7ec2128

16 files changed

+615
-4
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.5.1.dev2",
7-
"regenerated": "2021-10-15 19:45:07.583517",
8-
"spec_repo_commit": "9ad7087"
7+
"regenerated": "2021-10-15 20:21:48.679835",
8+
"spec_repo_commit": "452360f"
99
},
1010
"v2": {
1111
"apigentools_version": "1.5.1.dev2",
12-
"regenerated": "2021-10-15 19:46:19.122327",
13-
"spec_repo_commit": "9ad7087"
12+
"regenerated": "2021-10-15 20:22:51.786005",
13+
"spec_repo_commit": "452360f"
1414
}
1515
}
1616
}

docs/v1/UsageMeteringApi.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ All URIs are relative to *https://api.datadoghq.com*
2929
| [**getUsageNetworkHosts**](UsageMeteringApi.md#getUsageNetworkHosts) | **GET** /api/v1/usage/network_hosts | Get hourly usage for Network Hosts |
3030
| [**getUsageProfiling**](UsageMeteringApi.md#getUsageProfiling) | **GET** /api/v1/usage/profiling | Get hourly usage for profiled hosts |
3131
| [**getUsageRumSessions**](UsageMeteringApi.md#getUsageRumSessions) | **GET** /api/v1/usage/rum_sessions | Get hourly usage for RUM Sessions |
32+
| [**getUsageSDS**](UsageMeteringApi.md#getUsageSDS) | **GET** /api/v1/usage/sds | Get hourly usage for Sensitive Data Scanner |
3233
| [**getUsageSNMP**](UsageMeteringApi.md#getUsageSNMP) | **GET** /api/v1/usage/snmp | Get hourly usage for SNMP devices |
3334
| [**getUsageSummary**](UsageMeteringApi.md#getUsageSummary) | **GET** /api/v1/usage/summary | Get usage across your multi-org account |
3435
| [**getUsageSynthetics**](UsageMeteringApi.md#getUsageSynthetics) | **GET** /api/v1/usage/synthetics | Get hourly usage for Synthetics Checks |
@@ -1606,6 +1607,68 @@ apiInstance
16061607

16071608
[[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)
16081609

1610+
## **getUsageSDS**
1611+
1612+
> UsageSDSResponse getUsageSDS()
1613+
1614+
Get hourly usage for Sensitive Data Scanner.
1615+
1616+
### Example
1617+
1618+
```typescript
1619+
import { v1 } from "@datadog/datadog-api-client";
1620+
import * as fs from "fs";
1621+
1622+
const configuration = v1.createConfiguration();
1623+
const apiInstance = new v1.UsageMeteringApi(configuration);
1624+
1625+
let params: v1.UsageMeteringApiGetUsageSDSRequest = {
1626+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
1627+
startHr: new Date("1970-01-01T00:00:00.00Z"),
1628+
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. (optional)
1629+
endHr: new Date("1970-01-01T00:00:00.00Z"),
1630+
};
1631+
1632+
apiInstance
1633+
.getUsageSDS(params)
1634+
.then((data: any) => {
1635+
console.log(
1636+
"API called successfully. Returned data: " + JSON.stringify(data)
1637+
);
1638+
})
1639+
.catch((error: any) => console.error(error));
1640+
```
1641+
1642+
### Parameters
1643+
1644+
| Name | Type | Description | Notes |
1645+
| ----------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
1646+
| **startHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour. | defaults to undefined |
1647+
| **endHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour. | (optional) defaults to undefined |
1648+
1649+
### Return type
1650+
1651+
**UsageSDSResponse**
1652+
1653+
### Authorization
1654+
1655+
[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)
1656+
1657+
### HTTP request headers
1658+
1659+
- **Content-Type**: Not defined
1660+
- **Accept**: application/json;datetime-format=rfc3339
1661+
1662+
### HTTP response details
1663+
1664+
| Status code | Description | Response headers |
1665+
| ----------- | ---------------------------------- | ---------------- |
1666+
| **200** | OK | - |
1667+
| **400** | Bad Request | - |
1668+
| **403** | Forbidden - User is not authorized | - |
1669+
1670+
[[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)
1671+
16091672
## **getUsageSNMP**
16101673

16111674
> UsageSNMPResponse getUsageSNMP()

features/v1/undo.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,12 @@
12731273
"type": "safe"
12741274
}
12751275
},
1276+
"GetUsageSDS": {
1277+
"tag": "Usage Metering",
1278+
"undo": {
1279+
"type": "safe"
1280+
}
1281+
},
12761282
"GetUsageSNMP": {
12771283
"tag": "Usage Metering",
12781284
"undo": {

features/v1/usage_metering.feature

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@ Feature: Usage Metering
199199
When the request is sent
200200
Then the response status is 200 OK
201201

202+
@generated @skip
203+
Scenario: Get hourly usage for Sensitive Data Scanner returns "Bad Request" response
204+
Given new "GetUsageSDS" request
205+
When the request is sent
206+
Then the response status is 400 Bad Request
207+
208+
@generated @skip
209+
Scenario: Get hourly usage for Sensitive Data Scanner returns "OK" response
210+
Given new "GetUsageSDS" request
211+
When the request is sent
212+
Then the response status is 200 OK
213+
202214
@generated @skip
203215
Scenario: Get hourly usage for Synthetics API Checks returns "Bad Request" response
204216
Given new "GetUsageSyntheticsAPI" request

packages/datadog-api-client-v1/.openapi-generator/FILES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,8 @@ models/UsageProfilingResponse.ts
623623
models/UsageReportsType.ts
624624
models/UsageRumSessionsHour.ts
625625
models/UsageRumSessionsResponse.ts
626+
models/UsageSDSHour.ts
627+
models/UsageSDSResponse.ts
626628
models/UsageSNMPHour.ts
627629
models/UsageSNMPResponse.ts
628630
models/UsageSort.ts

packages/datadog-api-client-v1/apis/UsageMeteringApi.ts

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import { UsageNetworkFlowsResponse } from "../models/UsageNetworkFlowsResponse";
3131
import { UsageNetworkHostsResponse } from "../models/UsageNetworkHostsResponse";
3232
import { UsageProfilingResponse } from "../models/UsageProfilingResponse";
3333
import { UsageRumSessionsResponse } from "../models/UsageRumSessionsResponse";
34+
import { UsageSDSResponse } from "../models/UsageSDSResponse";
3435
import { UsageSNMPResponse } from "../models/UsageSNMPResponse";
3536
import { UsageSort } from "../models/UsageSort";
3637
import { UsageSortDirection } from "../models/UsageSortDirection";
@@ -1821,6 +1822,72 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
18211822
return requestContext;
18221823
}
18231824

1825+
/**
1826+
* Get hourly usage for Sensitive Data Scanner.
1827+
* Get hourly usage for Sensitive Data Scanner
1828+
* @param startHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage beginning at this hour.
1829+
* @param endHr Datetime in ISO-8601 format, UTC, precise to hour: &#x60;[YYYY-MM-DDThh]&#x60; for usage ending **before** this hour.
1830+
*/
1831+
public async getUsageSDS(
1832+
startHr: Date,
1833+
endHr?: Date,
1834+
_options?: Configuration
1835+
): Promise<RequestContext> {
1836+
const _config = _options || this.configuration;
1837+
1838+
// verify required parameter 'startHr' is not null or undefined
1839+
if (startHr === null || startHr === undefined) {
1840+
throw new RequiredError(
1841+
"Required parameter startHr was null or undefined when calling getUsageSDS."
1842+
);
1843+
}
1844+
1845+
// Path Params
1846+
const localVarPath = "/api/v1/usage/sds";
1847+
1848+
// Make Request Context
1849+
const requestContext = getServer(
1850+
_config,
1851+
"UsageMeteringApi.getUsageSDS"
1852+
).makeRequestContext(localVarPath, HttpMethod.GET);
1853+
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
1854+
requestContext.setHttpConfig(_config.httpConfig);
1855+
1856+
// Query Params
1857+
if (startHr !== undefined) {
1858+
requestContext.setQueryParam(
1859+
"start_hr",
1860+
ObjectSerializer.serialize(startHr, "Date", "date-time")
1861+
);
1862+
}
1863+
if (endHr !== undefined) {
1864+
requestContext.setQueryParam(
1865+
"end_hr",
1866+
ObjectSerializer.serialize(endHr, "Date", "date-time")
1867+
);
1868+
}
1869+
1870+
// Header Params
1871+
1872+
// Form Params
1873+
1874+
// Body Params
1875+
1876+
let authMethod = null;
1877+
// Apply auth methods
1878+
authMethod = _config.authMethods["apiKeyAuth"];
1879+
if (authMethod) {
1880+
await authMethod.applySecurityAuthentication(requestContext);
1881+
}
1882+
// Apply auth methods
1883+
authMethod = _config.authMethods["appKeyAuth"];
1884+
if (authMethod) {
1885+
await authMethod.applySecurityAuthentication(requestContext);
1886+
}
1887+
1888+
return requestContext;
1889+
}
1890+
18241891
/**
18251892
* Get hourly usage for SNMP devices.
18261893
* Get hourly usage for SNMP devices
@@ -3712,6 +3779,61 @@ export class UsageMeteringApiResponseProcessor {
37123779
);
37133780
}
37143781

3782+
/**
3783+
* Unwraps the actual response sent by the server from the response context and deserializes the response content
3784+
* to the expected objects
3785+
*
3786+
* @params response Response returned by the server for a request to getUsageSDS
3787+
* @throws ApiException if the response code was not in [200, 299]
3788+
*/
3789+
public async getUsageSDS(
3790+
response: ResponseContext
3791+
): Promise<UsageSDSResponse> {
3792+
const contentType = ObjectSerializer.normalizeMediaType(
3793+
response.headers["content-type"]
3794+
);
3795+
if (isCodeInRange("200", response.httpStatusCode)) {
3796+
const body: UsageSDSResponse = ObjectSerializer.deserialize(
3797+
ObjectSerializer.parse(await response.body.text(), contentType),
3798+
"UsageSDSResponse",
3799+
""
3800+
) as UsageSDSResponse;
3801+
return body;
3802+
}
3803+
if (isCodeInRange("400", response.httpStatusCode)) {
3804+
const body: APIErrorResponse = ObjectSerializer.deserialize(
3805+
ObjectSerializer.parse(await response.body.text(), contentType),
3806+
"APIErrorResponse",
3807+
""
3808+
) as APIErrorResponse;
3809+
throw new ApiException<APIErrorResponse>(400, body);
3810+
}
3811+
if (isCodeInRange("403", response.httpStatusCode)) {
3812+
const body: APIErrorResponse = ObjectSerializer.deserialize(
3813+
ObjectSerializer.parse(await response.body.text(), contentType),
3814+
"APIErrorResponse",
3815+
""
3816+
) as APIErrorResponse;
3817+
throw new ApiException<APIErrorResponse>(403, body);
3818+
}
3819+
3820+
// Work around for missing responses in specification, e.g. for petstore.yaml
3821+
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
3822+
const body: UsageSDSResponse = ObjectSerializer.deserialize(
3823+
ObjectSerializer.parse(await response.body.text(), contentType),
3824+
"UsageSDSResponse",
3825+
""
3826+
) as UsageSDSResponse;
3827+
return body;
3828+
}
3829+
3830+
const body = (await response.body.text()) || "";
3831+
throw new ApiException<string>(
3832+
response.httpStatusCode,
3833+
'Unknown API Status Code!\nBody: "' + body + '"'
3834+
);
3835+
}
3836+
37153837
/**
37163838
* Unwraps the actual response sent by the server from the response context and deserializes the response content
37173839
* to the expected objects

packages/datadog-api-client-v1/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ export {
198198
UsageMeteringApiGetUsageNetworkHostsRequest,
199199
UsageMeteringApiGetUsageProfilingRequest,
200200
UsageMeteringApiGetUsageRumSessionsRequest,
201+
UsageMeteringApiGetUsageSDSRequest,
201202
UsageMeteringApiGetUsageSNMPRequest,
202203
UsageMeteringApiGetUsageSummaryRequest,
203204
UsageMeteringApiGetUsageSyntheticsRequest,

packages/datadog-api-client-v1/models/ObjectSerializer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,8 @@ import { UsageProfilingHour } from "./UsageProfilingHour";
418418
import { UsageProfilingResponse } from "./UsageProfilingResponse";
419419
import { UsageRumSessionsHour } from "./UsageRumSessionsHour";
420420
import { UsageRumSessionsResponse } from "./UsageRumSessionsResponse";
421+
import { UsageSDSHour } from "./UsageSDSHour";
422+
import { UsageSDSResponse } from "./UsageSDSResponse";
421423
import { UsageSNMPHour } from "./UsageSNMPHour";
422424
import { UsageSNMPResponse } from "./UsageSNMPResponse";
423425
import { UsageSpecifiedCustomReportsAttributes } from "./UsageSpecifiedCustomReportsAttributes";
@@ -1085,6 +1087,8 @@ const typeMap: { [index: string]: any } = {
10851087
UsageProfilingResponse: UsageProfilingResponse,
10861088
UsageRumSessionsHour: UsageRumSessionsHour,
10871089
UsageRumSessionsResponse: UsageRumSessionsResponse,
1090+
UsageSDSHour: UsageSDSHour,
1091+
UsageSDSResponse: UsageSDSResponse,
10881092
UsageSNMPHour: UsageSNMPHour,
10891093
UsageSNMPResponse: UsageSNMPResponse,
10901094
UsageSpecifiedCustomReportsAttributes: UsageSpecifiedCustomReportsAttributes,

0 commit comments

Comments
 (0)