Skip to content

Commit

Permalink
Regenerate client from commit fdfbfe22 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed May 30, 2023
1 parent 52853d3 commit c711282
Show file tree
Hide file tree
Showing 6 changed files with 305 additions and 27 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-05-26 17:55:29.683135",
"spec_repo_commit": "c4844513"
"regenerated": "2023-05-30 12:11:50.988643",
"spec_repo_commit": "fdfbfe22"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-05-26 17:55:29.696455",
"spec_repo_commit": "c4844513"
"regenerated": "2023-05-30 12:11:51.005943",
"spec_repo_commit": "fdfbfe22"
}
}
}
113 changes: 90 additions & 23 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,50 @@ components:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Conflict
FindingsBadRequestResponse:
content:
application/json:
example:
errors:
- description: Invalid filters
status: '400'
title: Bad request
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: Bad Request
FindingsForbiddenResponse:
content:
application/json:
example:
errors:
- description: Forbidden
status: '403'
title: Forbidden
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: Forbidden
FindingsNotFoundResponse:
content:
application/json:
example:
errors:
- description: No findings found
status: '404'
title: Not Found
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: Not Found
FindingsTooManyRequestsResponse:
content:
application/json:
example:
errors:
- description: Rate limit exceeded
status: '404'
title: Too Many Requests
schema:
$ref: '#/components/schemas/FindingsErrorResponse'
description: Too Many Requests
ForbiddenResponse:
content:
application/json:
Expand Down Expand Up @@ -3824,6 +3868,34 @@ components:
type: string
x-enum-varnames:
- FINDING
FindingsErrorItem:
description: An error item.
properties:
detail:
description: A human-readable explanation specific to this occurrence of
the error.
example: Bad parameter
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: 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 @@ -19480,13 +19552,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 @@ -19586,17 +19661,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 @@ -19641,17 +19712,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
2 changes: 2 additions & 0 deletions lib/datadog_api_client/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,8 @@ def overrides
"v2.finding_mute" => "FindingMute",
"v2.finding_mute_reason" => "FindingMuteReason",
"v2.finding_rule" => "FindingRule",
"v2.findings_error_item" => "FindingsErrorItem",
"v2.findings_error_response" => "FindingsErrorResponse",
"v2.finding_status" => "FindingStatus",
"v2.finding_type" => "FindingType",
"v2.formula_limit" => "FormulaLimit",
Expand Down
2 changes: 2 additions & 0 deletions lib/datadog_api_client/v2/api/security_monitoring_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,8 @@ def list_findings(opts = {})
#
# 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
107 changes: 107 additions & 0 deletions lib/datadog_api_client/v2/models/findings_error_item.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# An error item.
class FindingsErrorItem
include BaseGenericModel

# A human-readable explanation specific to this occurrence of the error.
attr_accessor :detail

# Status code of the response.
attr_accessor :status

# Short human-readable summary of the error.
attr_accessor :title

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'detail' => :'detail',
:'status' => :'status',
:'title' => :'title'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'detail' => :'String',
:'status' => :'String',
:'title' => :'String'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingsErrorItem` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::FindingsErrorItem`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'detail')
self.detail = attributes[:'detail']
end

if attributes.key?(:'status')
self.status = attributes[:'status']
end

if attributes.key?(:'title')
self.title = attributes[:'title']
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
true
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
detail == o.detail &&
status == o.status &&
title == o.title
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[detail, status, title].hash
end
end
end
100 changes: 100 additions & 0 deletions lib/datadog_api_client/v2/models/findings_error_response.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
=begin
#Datadog API V2 Collection
#Collection of all Datadog Public endpoints.
The version of the OpenAPI document: 1.0
Contact: support@datadoghq.com
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
This product includes software developed at Datadog (https://www.datadoghq.com/).
Copyright 2020-Present Datadog, Inc.
=end

require 'date'
require 'time'

module DatadogAPIClient::V2
# Error response.
class FindingsErrorResponse
include BaseGenericModel

# A list of errors.
attr_reader :errors

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'errors' => :'errors'
}
end

# Attribute type mapping.
# @!visibility private
def self.openapi_types
{
:'errors' => :'Array<FindingsErrorItem>'
}
end

# Initializes the object
# @param attributes [Hash] Model attributes in the form of hash
# @!visibility private
def initialize(attributes = {})
if (!attributes.is_a?(Hash))
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::FindingsErrorResponse` initialize method"
end

# check to see if the attribute exists and convert string to symbol for hash key
attributes = attributes.each_with_object({}) { |(k, v), h|
if (!self.class.attribute_map.key?(k.to_sym))
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::FindingsErrorResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
end
h[k.to_sym] = v
}

if attributes.key?(:'errors')
if (value = attributes[:'errors']).is_a?(Array)
self.errors = value
end
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @errors.nil?
true
end

# Custom attribute writer method with validation
# @param errors [Object] Object to be assigned
# @!visibility private
def errors=(errors)
if errors.nil?
fail ArgumentError, 'invalid value for "errors", errors cannot be nil.'
end
@errors = errors
end

# Checks equality by comparing each attribute.
# @param o [Object] Object to be compared
# @!visibility private
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
errors == o.errors
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[errors].hash
end
end
end

0 comments on commit c711282

Please sign in to comment.