Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .generated-info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"spec_repo_commit": "df31e44",
"generated": "2025-07-28 19:55:56.622"
"spec_repo_commit": "b75095c",
"generated": "2025-07-31 10:47:28.624"
}
95 changes: 88 additions & 7 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6891,14 +6891,16 @@ components:
- data
type: object
CaseAttributes:
description: Case attributes
description: Case resource attributes
properties:
archived_at:
description: Timestamp of when the case was archived
format: date-time
nullable: true
readOnly: true
type: string
attributes:
$ref: '#/components/schemas/CaseObjectAttributes'
closed_at:
description: Timestamp of when the case was closed
format: date-time
Expand Down Expand Up @@ -7003,6 +7005,13 @@ components:
required:
- data
type: object
CaseObjectAttributes:
additionalProperties:
items:
type: string
type: array
description: The definition of `CaseObjectAttributes` object.
type: object
CasePriority:
default: NOT_DEFINED
description: Case priority
Expand Down Expand Up @@ -7098,6 +7107,33 @@ components:
type: string
x-enum-varnames:
- STANDARD
CaseUpdateAttributes:
description: Case update attributes
properties:
attributes:
$ref: '#/components/schemas/CaseUpdateAttributesAttributes'
type:
$ref: '#/components/schemas/CaseResourceType'
required:
- attributes
- type
type: object
CaseUpdateAttributesAttributes:
description: Case update attributes attributes
properties:
attributes:
$ref: '#/components/schemas/CaseObjectAttributes'
required:
- attributes
type: object
CaseUpdateAttributesRequest:
description: Case update attributes request
properties:
data:
$ref: '#/components/schemas/CaseUpdateAttributes'
required:
- data
type: object
CaseUpdatePriority:
description: Case priority status
properties:
Expand Down Expand Up @@ -45579,6 +45615,44 @@ paths:
summary: Assign case
tags:
- Case Management
/api/v2/cases/{case_id}/attributes:
post:
description: Update case attributes
operationId: UpdateAttributes
parameters:
- $ref: '#/components/parameters/CaseIDPathParameter'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CaseUpdateAttributesRequest'
description: Case attributes update payload
required: true
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/CaseResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'401':
$ref: '#/components/responses/UnauthorizedResponse'
'403':
$ref: '#/components/responses/ForbiddenResponse'
'404':
$ref: '#/components/responses/NotFoundResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- cases_write
summary: Update case attributes
tags:
- Case Management
/api/v2/cases/{case_id}/priority:
post:
description: Update case priority
Expand Down Expand Up @@ -56012,12 +56086,13 @@ paths:
following fields are available for findings:\n- `external_id`: The resource
external ID related to the finding.\n- `description`: The description and
remediation steps for the finding.\n- `datadog_link`: The Datadog relative
link for the finding.\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`
link for the finding.\n- `ip_addresses`: The list of private IP addresses
for the resource related to the finding.\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:
Expand Down Expand Up @@ -56088,6 +56163,12 @@ paths:
required: false
schema:
type: string
- description: Return only findings for the specified resource id.
in: query
name: filter[@resource_id]
required: false
schema:
type: string
- description: Return findings that were found on a specified date (Unix ms)
or date range (using comparison operators).
example: '>=1678721573794'
Expand Down
81 changes: 81 additions & 0 deletions api/datadogV2/api_case_management.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,6 +993,87 @@ func (a *CaseManagementApi) UnassignCase(ctx _context.Context, caseId string, bo
return localVarReturnValue, localVarHTTPResponse, nil
}

// UpdateAttributes Update case attributes.
// Update case attributes
func (a *CaseManagementApi) UpdateAttributes(ctx _context.Context, caseId string, body CaseUpdateAttributesRequest) (CaseResponse, *_nethttp.Response, error) {
var (
localVarHTTPMethod = _nethttp.MethodPost
localVarPostBody interface{}
localVarReturnValue CaseResponse
)

localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.CaseManagementApi.UpdateAttributes")
if err != nil {
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "/api/v2/cases/{case_id}/attributes"
localVarPath = datadog.ReplacePathParameter(localVarPath, "{case_id}", _neturl.PathEscape(datadog.ParameterToString(caseId, "")))

localVarHeaderParams := make(map[string]string)
localVarQueryParams := _neturl.Values{}
localVarFormParams := _neturl.Values{}
localVarHeaderParams["Content-Type"] = "application/json"
localVarHeaderParams["Accept"] = "application/json"

// body params
localVarPostBody = &body
if a.Client.Cfg.DelegatedTokenConfig != nil {
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
if err != nil {
return localVarReturnValue, nil, err
}
} else {
datadog.SetAuthKeys(
ctx,
&localVarHeaderParams,
[2]string{"apiKeyAuth", "DD-API-KEY"},
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
)
}
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
if err != nil {
return localVarReturnValue, nil, err
}

localVarHTTPResponse, err := a.Client.CallAPI(req)
if err != nil || localVarHTTPResponse == nil {
return localVarReturnValue, localVarHTTPResponse, err
}

localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
if err != nil {
return localVarReturnValue, localVarHTTPResponse, err
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
}
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 401 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
var v APIErrorResponse
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
return localVarReturnValue, localVarHTTPResponse, newErr
}
newErr.ErrorModel = v
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := datadog.GenericOpenAPIError{
ErrorBody: localVarBody,
ErrorMessage: err.Error(),
}
return localVarReturnValue, localVarHTTPResponse, newErr
}

return localVarReturnValue, localVarHTTPResponse, nil
}

// UpdatePriority Update case priority.
// Update case priority
func (a *CaseManagementApi) UpdatePriority(ctx _context.Context, caseId string, body CaseUpdatePriorityRequest) (CaseResponse, *_nethttp.Response, error) {
Expand Down
11 changes: 11 additions & 0 deletions api/datadogV2/api_security_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -3054,6 +3054,7 @@ type ListFindingsOptionalParameters struct {
FilterRuleId *string
FilterRuleName *string
FilterResourceType *string
FilterResourceId *string
FilterDiscoveryTimestamp *string
FilterEvaluation *FindingEvaluation
FilterStatus *FindingStatus
Expand Down Expand Up @@ -3121,6 +3122,12 @@ func (r *ListFindingsOptionalParameters) WithFilterResourceType(filterResourceTy
return r
}

// WithFilterResourceId sets the corresponding parameter name and returns the struct.
func (r *ListFindingsOptionalParameters) WithFilterResourceId(filterResourceId string) *ListFindingsOptionalParameters {
r.FilterResourceId = &filterResourceId
return r
}

// WithFilterDiscoveryTimestamp sets the corresponding parameter name and returns the struct.
func (r *ListFindingsOptionalParameters) WithFilterDiscoveryTimestamp(filterDiscoveryTimestamp string) *ListFindingsOptionalParameters {
r.FilterDiscoveryTimestamp = &filterDiscoveryTimestamp
Expand Down Expand Up @@ -3184,6 +3191,7 @@ func (r *ListFindingsOptionalParameters) WithDetailedFindings(detailedFindings b
// - `external_id`: The resource external ID related to the finding.
// - `description`: The description and remediation steps for the finding.
// - `datadog_link`: The Datadog relative link for the finding.
// - `ip_addresses`: The list of private IP addresses for the resource related to the finding.
//
// ### Response
//
Expand Down Expand Up @@ -3256,6 +3264,9 @@ func (a *SecurityMonitoringApi) ListFindings(ctx _context.Context, o ...ListFind
if optionalParams.FilterResourceType != nil {
localVarQueryParams.Add("filter[resource_type]", datadog.ParameterToString(*optionalParams.FilterResourceType, ""))
}
if optionalParams.FilterResourceId != nil {
localVarQueryParams.Add("filter[@resource_id]", datadog.ParameterToString(*optionalParams.FilterResourceId, ""))
}
if optionalParams.FilterDiscoveryTimestamp != nil {
localVarQueryParams.Add("filter[discovery_timestamp]", datadog.ParameterToString(*optionalParams.FilterDiscoveryTimestamp, ""))
}
Expand Down
1 change: 1 addition & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
// - [CaseManagementApi.SearchCases]
// - [CaseManagementApi.UnarchiveCase]
// - [CaseManagementApi.UnassignCase]
// - [CaseManagementApi.UpdateAttributes]
// - [CaseManagementApi.UpdatePriority]
// - [CaseManagementApi.UpdateStatus]
// - [CloudCostManagementApi.CreateCostAWSCURConfig]
Expand Down
2 changes: 1 addition & 1 deletion api/datadogV2/model_case.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

// Case A case
type Case struct {
// Case attributes
// Case resource attributes
Attributes CaseAttributes `json:"attributes"`
// Case's identifier
Id string `json:"id"`
Expand Down
39 changes: 37 additions & 2 deletions api/datadogV2/model_case_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// CaseAttributes Case attributes
// CaseAttributes Case resource attributes
type CaseAttributes struct {
// Timestamp of when the case was archived
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
// The definition of `CaseObjectAttributes` object.
Attributes map[string][]string `json:"attributes,omitempty"`
// Timestamp of when the case was closed
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
// Timestamp of when the case was created
Expand Down Expand Up @@ -101,6 +103,34 @@ func (o *CaseAttributes) UnsetArchivedAt() {
o.ArchivedAt.Unset()
}

// GetAttributes returns the Attributes field value if set, zero value otherwise.
func (o *CaseAttributes) GetAttributes() map[string][]string {
if o == nil || o.Attributes == nil {
var ret map[string][]string
return ret
}
return o.Attributes
}

// GetAttributesOk returns a tuple with the Attributes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CaseAttributes) GetAttributesOk() (*map[string][]string, bool) {
if o == nil || o.Attributes == nil {
return nil, false
}
return &o.Attributes, true
}

// HasAttributes returns a boolean if a field has been set.
func (o *CaseAttributes) HasAttributes() bool {
return o != nil && o.Attributes != nil
}

// SetAttributes gets a reference to the given map[string][]string and assigns it to the Attributes field.
func (o *CaseAttributes) SetAttributes(v map[string][]string) {
o.Attributes = v
}

// GetClosedAt returns the ClosedAt field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CaseAttributes) GetClosedAt() time.Time {
if o == nil || o.ClosedAt.Get() == nil {
Expand Down Expand Up @@ -462,6 +492,9 @@ func (o CaseAttributes) MarshalJSON() ([]byte, error) {
if o.ArchivedAt.IsSet() {
toSerialize["archived_at"] = o.ArchivedAt.Get()
}
if o.Attributes != nil {
toSerialize["attributes"] = o.Attributes
}
if o.ClosedAt.IsSet() {
toSerialize["closed_at"] = o.ClosedAt.Get()
}
Expand Down Expand Up @@ -510,6 +543,7 @@ func (o CaseAttributes) MarshalJSON() ([]byte, error) {
func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ArchivedAt datadog.NullableTime `json:"archived_at,omitempty"`
Attributes map[string][]string `json:"attributes,omitempty"`
ClosedAt datadog.NullableTime `json:"closed_at,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
Description *string `json:"description,omitempty"`
Expand All @@ -527,13 +561,14 @@ func (o *CaseAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "closed_at", "created_at", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type"})
datadog.DeleteKeys(additionalProperties, &[]string{"archived_at", "attributes", "closed_at", "created_at", "description", "jira_issue", "key", "modified_at", "priority", "service_now_ticket", "status", "title", "type"})
} else {
return err
}

hasInvalidField := false
o.ArchivedAt = all.ArchivedAt
o.Attributes = all.Attributes
o.ClosedAt = all.ClosedAt
o.CreatedAt = all.CreatedAt
o.Description = all.Description
Expand Down
Loading
Loading