Skip to content

Commit

Permalink
Regenerate client from commit b863f573 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jun 14, 2023
1 parent 6485c3a commit 3ebf1e2
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 115 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": "2023-06-14 07:20:46.323324",
"spec_repo_commit": "87ef2d8d"
"regenerated": "2023-06-14 08:27:32.418998",
"spec_repo_commit": "b863f573"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-06-14 07:20:46.341098",
"spec_repo_commit": "87ef2d8d"
"regenerated": "2023-06-14 08:27:32.432028",
"spec_repo_commit": "b863f573"
}
}
}
148 changes: 78 additions & 70 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,31 @@ components:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Conflict
FindingsBadRequestResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Bad Request: The server cannot process the request due to invalid
syntax in the request.'
FindingsForbiddenResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Forbidden: Access denied'
FindingsNotFoundResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Not Found: The requested finding cannot be found.'
FindingsTooManyRequestsResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Too many requests: The rate limit set by the API has been exceeded.'
ForbiddenResponse:
content:
application/json:
Expand Down Expand Up @@ -4520,34 +4545,6 @@ components:
type: string
x-enum-varnames:
- FINDING
FindingsErrorItem:
description: API error response body
properties:
detail:
description: A human-readable explanation specific to this occurrence of
the error.
example: attribute "muted" is required
type: string
status:
description: Status code of the response.
example: '400'
type: string
title:
description: Short human-readable summary of the error.
example: Bad Request
type: string
type: object
FindingsErrorResponse:
description: API error response.
properties:
errors:
description: A list of errors.
items:
$ref: '#/components/schemas/FindingsErrorItem'
type: array
required:
- errors
type: object
FormulaLimit:
description: Message for specifying limits to the number of values returned
by a query.
Expand Down Expand Up @@ -10643,6 +10640,34 @@ components:
from the other indexes
type: string
type: object
RapidErrorItem:
description: API error response body
properties:
detail:
description: A human-readable explanation specific to this occurrence of
the error.
example: Missing required attribute in body
type: string
status:
description: Status code of the response.
example: '400'
type: string
title:
description: Short human-readable summary of the error.
example: Bad Request
type: string
type: object
RapidErrorResponse:
description: Rapid API error response.
properties:
errors:
description: A list of errors.
items:
$ref: '#/components/schemas/RapidErrorItem'
type: array
required:
- errors
type: object
RelationshipToIncidentAttachment:
description: A relationship reference for attachments.
properties:
Expand Down Expand Up @@ -20715,13 +20740,16 @@ paths:
can also use the negation operator on strings. For example, use `filter[resource_type]=-aws*`
to filter for any non-AWS resources.\n\nThe operator must come after the equal
sign. For example, to filter with the `>=` operator, add the operator after
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\n### Response\n\nThe
response includes an array of finding objects, pagination metadata, and a
count of items that match the query.\n\nEach finding object contains the following:\n\n-
The finding ID that can be used in a `GetFinding` request to retrieve the
full finding details.\n- Core attributes, including status, evaluation, high-level
resource details, muted state, and rule details.\n- `evaluation_changed_at`
and `resource_discovery_date` time stamps.\n- An array of associated tags.\n"
the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.\n\nQuery
parameters must be only among the documented ones and with values of correct
types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`)
are not allowed.\n\n### Response\n\nThe response includes an array of finding
objects, pagination metadata, and a count of items that match the query.\n\nEach
finding object contains the following:\n\n- The finding ID that can be used
in a `GetFinding` request to retrieve the full finding details.\n- Core attributes,
including status, evaluation, high-level resource details, muted state, and
rule details.\n- `evaluation_changed_at` and `resource_discovery_date` time
stamps.\n- An array of associated tags.\n"
operationId: ListFindings
parameters:
- description: Limit the number of findings returned. Must be <= 1000.
Expand Down Expand Up @@ -20821,17 +20849,13 @@ paths:
$ref: '#/components/schemas/ListFindingsResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
$ref: '#/components/responses/FindingsBadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
$ref: '#/components/responses/FindingsForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
$ref: '#/components/responses/FindingsNotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
$ref: '#/components/responses/FindingsTooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
Expand Down Expand Up @@ -20876,17 +20900,13 @@ paths:
$ref: '#/components/schemas/GetFindingResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
$ref: '#/components/responses/FindingsBadRequestResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
$ref: '#/components/responses/FindingsForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
$ref: '#/components/responses/FindingsNotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
$ref: '#/components/responses/FindingsTooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
Expand Down Expand Up @@ -20934,39 +20954,27 @@ paths:
$ref: '#/components/schemas/MuteFindingResponse'
description: OK
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Bad Request: The server cannot process the request due to
invalid syntax in the request.'
$ref: '#/components/responses/FindingsBadRequestResponse'
'403':
$ref: '#/components/responses/FindingsForbiddenResponse'
'404':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Not Found: The requested finding cannot be found.'
$ref: '#/components/responses/FindingsNotFoundResponse'
'409':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Resource Conflict: The finding has already been muted or unmuted
within the last 60 seconds.'
'422':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
$ref: '#/components/schemas/RapidErrorResponse'
description: 'Invalid Request: The server understands the request syntax
but cannot process it due to invalid data.'
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: 'Too many requests: The rate limit set by the API has been
exceeded.'
$ref: '#/components/responses/FindingsTooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
Expand Down
16 changes: 8 additions & 8 deletions features/v2/security_monitoring.feature
Original file line number Diff line number Diff line change
Expand Up @@ -199,20 +199,20 @@ Feature: Security Monitoring
And the response "id" has the same value as "cloud_configuration_rule.id"

@generated @skip @team:DataDog/cloud-security-posture-management
Scenario: Get a finding returns "Bad Request" response
Scenario: Get a finding returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response
Given operation "GetFinding" enabled
And new "GetFinding" request
And request contains "finding_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 400 Bad Request
Then the response status is 400 Bad Request: The server cannot process the request due to invalid syntax in the request.

@generated @skip @team:DataDog/cloud-security-posture-management
Scenario: Get a finding returns "Not Found" response
Scenario: Get a finding returns "Not Found: The requested finding cannot be found." response
Given operation "GetFinding" enabled
And new "GetFinding" request
And request contains "finding_id" parameter from "REPLACE.ME"
When the request is sent
Then the response status is 404 Not Found
Then the response status is 404 Not Found: The requested finding cannot be found.

@replay-only @team:DataDog/cloud-security-posture-management
Scenario: Get a finding returns "OK" response
Expand Down Expand Up @@ -325,18 +325,18 @@ Feature: Security Monitoring
And the response "data" has item with field "attributes.is_builtin" with value true

@generated @skip @team:DataDog/cloud-security-posture-management
Scenario: List findings returns "Bad Request" response
Scenario: List findings returns "Bad Request: The server cannot process the request due to invalid syntax in the request." response
Given operation "ListFindings" enabled
And new "ListFindings" request
When the request is sent
Then the response status is 400 Bad Request
Then the response status is 400 Bad Request: The server cannot process the request due to invalid syntax in the request.

@generated @skip @team:DataDog/cloud-security-posture-management
Scenario: List findings returns "Not Found" response
Scenario: List findings returns "Not Found: The requested finding cannot be found." response
Given operation "ListFindings" enabled
And new "ListFindings" request
When the request is sent
Then the response status is 404 Not Found
Then the response status is 404 Not Found: The requested finding cannot be found.

@replay-only @team:DataDog/cloud-security-posture-management
Scenario: List findings returns "OK" response
Expand Down
38 changes: 19 additions & 19 deletions packages/datadog-api-client-v2/apis/SecurityMonitoringApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import { ApiException } from "../../datadog-api-client-common/exception";
import { APIErrorResponse } from "../models/APIErrorResponse";
import { Finding } from "../models/Finding";
import { FindingEvaluation } from "../models/FindingEvaluation";
import { FindingsErrorResponse } from "../models/FindingsErrorResponse";
import { FindingStatus } from "../models/FindingStatus";
import { GetFindingResponse } from "../models/GetFindingResponse";
import { ListFindingsResponse } from "../models/ListFindingsResponse";
import { MuteFindingRequest } from "../models/MuteFindingRequest";
import { MuteFindingResponse } from "../models/MuteFindingResponse";
import { RapidErrorResponse } from "../models/RapidErrorResponse";
import { SecurityFilterCreateRequest } from "../models/SecurityFilterCreateRequest";
import { SecurityFilterResponse } from "../models/SecurityFilterResponse";
import { SecurityFiltersResponse } from "../models/SecurityFiltersResponse";
Expand Down Expand Up @@ -1469,20 +1469,20 @@ export class SecurityMonitoringApiResponseProcessor {
await response.body.text(),
contentType
);
let body: APIErrorResponse;
let body: RapidErrorResponse;
try {
body = ObjectSerializer.deserialize(
bodyText,
"APIErrorResponse"
) as APIErrorResponse;
"RapidErrorResponse"
) as RapidErrorResponse;
} catch (error) {
logger.info(`Got error deserializing error: ${error}`);
throw new ApiException<APIErrorResponse>(
throw new ApiException<RapidErrorResponse>(
response.httpStatusCode,
bodyText
);
}
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
throw new ApiException<RapidErrorResponse>(response.httpStatusCode, body);
}

// Work around for missing responses in specification, e.g. for petstore.yaml
Expand Down Expand Up @@ -1710,20 +1710,20 @@ export class SecurityMonitoringApiResponseProcessor {
await response.body.text(),
contentType
);
let body: APIErrorResponse;
let body: RapidErrorResponse;
try {
body = ObjectSerializer.deserialize(
bodyText,
"APIErrorResponse"
) as APIErrorResponse;
"RapidErrorResponse"
) as RapidErrorResponse;
} catch (error) {
logger.info(`Got error deserializing error: ${error}`);
throw new ApiException<APIErrorResponse>(
throw new ApiException<RapidErrorResponse>(
response.httpStatusCode,
bodyText
);
}
throw new ApiException<APIErrorResponse>(response.httpStatusCode, body);
throw new ApiException<RapidErrorResponse>(response.httpStatusCode, body);
}

// Work around for missing responses in specification, e.g. for petstore.yaml
Expand Down Expand Up @@ -2011,6 +2011,7 @@ export class SecurityMonitoringApiResponseProcessor {
}
if (
response.httpStatusCode == 400 ||
response.httpStatusCode == 403 ||
response.httpStatusCode == 404 ||
response.httpStatusCode == 409 ||
response.httpStatusCode == 422 ||
Expand All @@ -2020,23 +2021,20 @@ export class SecurityMonitoringApiResponseProcessor {
await response.body.text(),
contentType
);
let body: FindingsErrorResponse;
let body: RapidErrorResponse;
try {
body = ObjectSerializer.deserialize(
bodyText,
"FindingsErrorResponse"
) as FindingsErrorResponse;
"RapidErrorResponse"
) as RapidErrorResponse;
} catch (error) {
logger.info(`Got error deserializing error: ${error}`);
throw new ApiException<FindingsErrorResponse>(
throw new ApiException<RapidErrorResponse>(
response.httpStatusCode,
bodyText
);
}
throw new ApiException<FindingsErrorResponse>(
response.httpStatusCode,
body
);
throw new ApiException<RapidErrorResponse>(response.httpStatusCode, body);
}

// Work around for missing responses in specification, e.g. for petstore.yaml
Expand Down Expand Up @@ -2736,6 +2734,8 @@ export class SecurityMonitoringApi {
*
* The operator must come after the equal sign. For example, to filter with the `>=` operator, add the operator after the equal sign: `filter[evaluation_changed_at]=>=1678809373257`.
*
* Query parameters must be only among the documented ones and with values of correct types. Duplicated query parameters (e.g. `filter[status]=low&filter[status]=info`) are not allowed.
*
* ### Response
*
* The response includes an array of finding objects, pagination metadata, and a count of items that match the query.
Expand Down
Loading

0 comments on commit 3ebf1e2

Please sign in to comment.