Skip to content

Commit

Permalink
Regenerate client from commit b612d1b of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Oct 13, 2021
1 parent 2927778 commit db1092b
Show file tree
Hide file tree
Showing 16 changed files with 615 additions and 4 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.5.1.dev2",
"regenerated": "2021-10-12 09:02:05.158756",
"spec_repo_commit": "06c7795"
"regenerated": "2021-10-13 18:32:46.184063",
"spec_repo_commit": "b612d1b"
},
"v2": {
"apigentools_version": "1.5.1.dev2",
"regenerated": "2021-10-12 09:02:59.059051",
"spec_repo_commit": "06c7795"
"regenerated": "2021-10-13 18:33:39.862790",
"spec_repo_commit": "b612d1b"
}
}
}
63 changes: 63 additions & 0 deletions docs/v1/UsageMeteringApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All URIs are relative to *https://api.datadoghq.com*
| [**getUsageNetworkHosts**](UsageMeteringApi.md#getUsageNetworkHosts) | **GET** /api/v1/usage/network_hosts | Get hourly usage for Network Hosts |
| [**getUsageProfiling**](UsageMeteringApi.md#getUsageProfiling) | **GET** /api/v1/usage/profiling | Get hourly usage for profiled hosts |
| [**getUsageRumSessions**](UsageMeteringApi.md#getUsageRumSessions) | **GET** /api/v1/usage/rum_sessions | Get hourly usage for RUM Sessions |
| [**getUsageSDS**](UsageMeteringApi.md#getUsageSDS) | **GET** /api/v1/usage/sds | Get hourly usage for Sensitive Data Scanner |
| [**getUsageSNMP**](UsageMeteringApi.md#getUsageSNMP) | **GET** /api/v1/usage/snmp | Get hourly usage for SNMP devices |
| [**getUsageSummary**](UsageMeteringApi.md#getUsageSummary) | **GET** /api/v1/usage/summary | Get usage across your multi-org account |
| [**getUsageSynthetics**](UsageMeteringApi.md#getUsageSynthetics) | **GET** /api/v1/usage/synthetics | Get hourly usage for Synthetics Checks |
Expand Down Expand Up @@ -1606,6 +1607,68 @@ apiInstance

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

## **getUsageSDS**

> UsageSDSResponse getUsageSDS()
Get hourly usage for Sensitive Data Scanner

### Example

```typescript
import { v1 } from "@datadog/datadog-api-client";
import * as fs from "fs";

const configuration = v1.createConfiguration();
const apiInstance = new v1.UsageMeteringApi(configuration);

let params: v1.UsageMeteringApiGetUsageSDSRequest = {
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
startHr: new Date("1970-01-01T00:00:00.00Z"),
// Date | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. (optional)
endHr: new Date("1970-01-01T00:00:00.00Z"),
};

apiInstance
.getUsageSDS(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));
```

### Parameters

| Name | Type | Description | Notes |
| ----------- | ---------- | --------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| **startHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour. | defaults to undefined |
| **endHr** | [**Date**] | Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour. | (optional) defaults to undefined |

### Return type

**UsageSDSResponse**

### Authorization

[apiKeyAuth](README.md#apiKeyAuth), [appKeyAuth](README.md#appKeyAuth)

### HTTP request headers

- **Content-Type**: Not defined
- **Accept**: application/json;datetime-format=rfc3339

### HTTP response details

| Status code | Description | Response headers |
| ----------- | ---------------------------------- | ---------------- |
| **200** | OK | - |
| **400** | Bad Request | - |
| **403** | Forbidden - User is not authorized | - |

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

## **getUsageSNMP**

> UsageSNMPResponse getUsageSNMP()
Expand Down
6 changes: 6 additions & 0 deletions features/v1/undo.json
Original file line number Diff line number Diff line change
Expand Up @@ -1262,6 +1262,12 @@
"type": "safe"
}
},
"GetUsageSDS": {
"tag": "Usage Metering",
"undo": {
"type": "safe"
}
},
"GetUsageSNMP": {
"tag": "Usage Metering",
"undo": {
Expand Down
12 changes: 12 additions & 0 deletions features/v1/usage_metering.feature
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,18 @@ Feature: Usage Metering
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Get hourly usage for Sensitive Data Scanner returns "Bad Request" response
Given new "GetUsageSDS" request
When the request is sent
Then the response status is 400 Bad Request

@generated @skip
Scenario: Get hourly usage for Sensitive Data Scanner returns "OK" response
Given new "GetUsageSDS" request
When the request is sent
Then the response status is 200 OK

@generated @skip
Scenario: Get hourly usage for Synthetics API Checks returns "Bad Request" response
Given new "GetUsageSyntheticsAPI" request
Expand Down
2 changes: 2 additions & 0 deletions packages/datadog-api-client-v1/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,8 @@ models/UsageProfilingResponse.ts
models/UsageReportsType.ts
models/UsageRumSessionsHour.ts
models/UsageRumSessionsResponse.ts
models/UsageSDSHour.ts
models/UsageSDSResponse.ts
models/UsageSNMPHour.ts
models/UsageSNMPResponse.ts
models/UsageSort.ts
Expand Down
122 changes: 122 additions & 0 deletions packages/datadog-api-client-v1/apis/UsageMeteringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { UsageNetworkFlowsResponse } from "../models/UsageNetworkFlowsResponse";
import { UsageNetworkHostsResponse } from "../models/UsageNetworkHostsResponse";
import { UsageProfilingResponse } from "../models/UsageProfilingResponse";
import { UsageRumSessionsResponse } from "../models/UsageRumSessionsResponse";
import { UsageSDSResponse } from "../models/UsageSDSResponse";
import { UsageSNMPResponse } from "../models/UsageSNMPResponse";
import { UsageSort } from "../models/UsageSort";
import { UsageSortDirection } from "../models/UsageSortDirection";
Expand Down Expand Up @@ -1821,6 +1822,72 @@ export class UsageMeteringApiRequestFactory extends BaseAPIRequestFactory {
return requestContext;
}

/**
* Get hourly usage for Sensitive Data Scanner
* Get hourly usage for Sensitive Data Scanner
* @param startHr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage beginning at this hour.
* @param endHr Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]` for usage ending **before** this hour.
*/
public async getUsageSDS(
startHr: Date,
endHr?: Date,
_options?: Configuration
): Promise<RequestContext> {
const _config = _options || this.configuration;

// verify required parameter 'startHr' is not null or undefined
if (startHr === null || startHr === undefined) {
throw new RequiredError(
"Required parameter startHr was null or undefined when calling getUsageSDS."
);
}

// Path Params
const localVarPath = "/api/v1/usage/sds";

// Make Request Context
const requestContext = getServer(
_config,
"UsageMeteringApi.getUsageSDS"
).makeRequestContext(localVarPath, HttpMethod.GET);
requestContext.setHeaderParam("Accept", "application/json, */*;q=0.8");
requestContext.setHttpConfig(_config.httpConfig);

// Query Params
if (startHr !== undefined) {
requestContext.setQueryParam(
"start_hr",
ObjectSerializer.serialize(startHr, "Date", "date-time")
);
}
if (endHr !== undefined) {
requestContext.setQueryParam(
"end_hr",
ObjectSerializer.serialize(endHr, "Date", "date-time")
);
}

// Header Params

// Form Params

// Body Params

let authMethod = null;
// Apply auth methods
authMethod = _config.authMethods["apiKeyAuth"];
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}
// Apply auth methods
authMethod = _config.authMethods["appKeyAuth"];
if (authMethod) {
await authMethod.applySecurityAuthentication(requestContext);
}

return requestContext;
}

/**
* Get hourly usage for SNMP devices.
* Get hourly usage for SNMP devices
Expand Down Expand Up @@ -3712,6 +3779,61 @@ export class UsageMeteringApiResponseProcessor {
);
}

/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
*
* @params response Response returned by the server for a request to getUsageSDS
* @throws ApiException if the response code was not in [200, 299]
*/
public async getUsageSDS(
response: ResponseContext
): Promise<UsageSDSResponse> {
const contentType = ObjectSerializer.normalizeMediaType(
response.headers["content-type"]
);
if (isCodeInRange("200", response.httpStatusCode)) {
const body: UsageSDSResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"UsageSDSResponse",
""
) as UsageSDSResponse;
return body;
}
if (isCodeInRange("400", response.httpStatusCode)) {
const body: APIErrorResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"APIErrorResponse",
""
) as APIErrorResponse;
throw new ApiException<APIErrorResponse>(400, body);
}
if (isCodeInRange("403", response.httpStatusCode)) {
const body: APIErrorResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"APIErrorResponse",
""
) as APIErrorResponse;
throw new ApiException<APIErrorResponse>(403, body);
}

// Work around for missing responses in specification, e.g. for petstore.yaml
if (response.httpStatusCode >= 200 && response.httpStatusCode <= 299) {
const body: UsageSDSResponse = ObjectSerializer.deserialize(
ObjectSerializer.parse(await response.body.text(), contentType),
"UsageSDSResponse",
""
) as UsageSDSResponse;
return body;
}

const body = (await response.body.text()) || "";
throw new ApiException<string>(
response.httpStatusCode,
'Unknown API Status Code!\nBody: "' + body + '"'
);
}

/**
* Unwraps the actual response sent by the server from the response context and deserializes the response content
* to the expected objects
Expand Down
1 change: 1 addition & 0 deletions packages/datadog-api-client-v1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export {
UsageMeteringApiGetUsageNetworkHostsRequest,
UsageMeteringApiGetUsageProfilingRequest,
UsageMeteringApiGetUsageRumSessionsRequest,
UsageMeteringApiGetUsageSDSRequest,
UsageMeteringApiGetUsageSNMPRequest,
UsageMeteringApiGetUsageSummaryRequest,
UsageMeteringApiGetUsageSyntheticsRequest,
Expand Down
4 changes: 4 additions & 0 deletions packages/datadog-api-client-v1/models/ObjectSerializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ import { UsageProfilingHour } from "./UsageProfilingHour";
import { UsageProfilingResponse } from "./UsageProfilingResponse";
import { UsageRumSessionsHour } from "./UsageRumSessionsHour";
import { UsageRumSessionsResponse } from "./UsageRumSessionsResponse";
import { UsageSDSHour } from "./UsageSDSHour";
import { UsageSDSResponse } from "./UsageSDSResponse";
import { UsageSNMPHour } from "./UsageSNMPHour";
import { UsageSNMPResponse } from "./UsageSNMPResponse";
import { UsageSpecifiedCustomReportsAttributes } from "./UsageSpecifiedCustomReportsAttributes";
Expand Down Expand Up @@ -1077,6 +1079,8 @@ const typeMap: { [index: string]: any } = {
UsageProfilingResponse: UsageProfilingResponse,
UsageRumSessionsHour: UsageRumSessionsHour,
UsageRumSessionsResponse: UsageRumSessionsResponse,
UsageSDSHour: UsageSDSHour,
UsageSDSResponse: UsageSDSResponse,
UsageSNMPHour: UsageSNMPHour,
UsageSNMPResponse: UsageSNMPResponse,
UsageSpecifiedCustomReportsAttributes: UsageSpecifiedCustomReportsAttributes,
Expand Down
Loading

0 comments on commit db1092b

Please sign in to comment.