Skip to content

Commit

Permalink
Regenerate client from commit 279f186f of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 26, 2024
1 parent a552da4 commit 0c9be82
Show file tree
Hide file tree
Showing 4 changed files with 117 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.6.6",
"regenerated": "2024-09-25 18:39:36.323908",
"spec_repo_commit": "1fa8186c"
"regenerated": "2024-09-26 15:35:12.234221",
"spec_repo_commit": "279f186f"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-25 18:39:36.338632",
"spec_repo_commit": "1fa8186c"
"regenerated": "2024-09-26 15:35:12.250065",
"spec_repo_commit": "279f186f"
}
}
}
24 changes: 24 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9183,6 +9183,20 @@ components:
tags:
$ref: '#/components/schemas/FindingTags'
type: object
FindingDetectionType:
description: The detection type of the finding.
enum:
- misconfiguration
- attack_path
- identity_risk
- api_security
example: misconfiguration
type: string
x-enum-varnames:
- MISCONFIGURATION
- ATTACK_PATH
- IDENTITY_RISK
- API_SECURITY
FindingEvaluation:
description: The evaluation of the finding.
enum:
Expand Down Expand Up @@ -33705,6 +33719,16 @@ paths:
required: false
schema:
type: string
- description: Return findings that match the selected detection types (repeatable).
example:
- misconfiguration
in: query
name: filter[detection_type]
required: false
schema:
items:
$ref: '#/components/schemas/FindingDetectionType'
type: array
- description: Return findings that have these associated tags (repeatable).
example: filter[tags]=cloud_provider:aws&filter[tags]=aws_account:999999999999
in: query
Expand Down
19 changes: 19 additions & 0 deletions api/datadogV2/api_security_monitoring.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
_log "log"
_nethttp "net/http"
_neturl "net/url"
"reflect"
"strings"
"time"

Expand Down Expand Up @@ -1190,6 +1191,7 @@ type ListFindingsOptionalParameters struct {
PageLimit *int64
SnapshotTimestamp *int64
PageCursor *string
FilterDetectionType *[]FindingDetectionType
FilterTags *string
FilterEvaluationChangedAt *string
FilterMuted *bool
Expand Down Expand Up @@ -1225,6 +1227,12 @@ func (r *ListFindingsOptionalParameters) WithPageCursor(pageCursor string) *List
return r
}

// WithFilterDetectionType sets the corresponding parameter name and returns the struct.
func (r *ListFindingsOptionalParameters) WithFilterDetectionType(filterDetectionType []FindingDetectionType) *ListFindingsOptionalParameters {
r.FilterDetectionType = &filterDetectionType
return r
}

// WithFilterTags sets the corresponding parameter name and returns the struct.
func (r *ListFindingsOptionalParameters) WithFilterTags(filterTags string) *ListFindingsOptionalParameters {
r.FilterTags = &filterTags
Expand Down Expand Up @@ -1351,6 +1359,17 @@ func (a *SecurityMonitoringApi) ListFindings(ctx _context.Context, o ...ListFind
if optionalParams.PageCursor != nil {
localVarQueryParams.Add("page[cursor]", datadog.ParameterToString(*optionalParams.PageCursor, ""))
}
if optionalParams.FilterDetectionType != nil {
t := *optionalParams.FilterDetectionType
if reflect.TypeOf(t).Kind() == reflect.Slice {
s := reflect.ValueOf(t)
for i := 0; i < s.Len(); i++ {
localVarQueryParams.Add("filter[detection_type]", datadog.ParameterToString(s.Index(i), "multi"))
}
} else {
localVarQueryParams.Add("filter[detection_type]", datadog.ParameterToString(t, "multi"))
}
}
if optionalParams.FilterTags != nil {
localVarQueryParams.Add("filter[tags]", datadog.ParameterToString(*optionalParams.FilterTags, ""))
}
Expand Down
70 changes: 70 additions & 0 deletions api/datadogV2/model_finding_detection_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
// 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 2019-Present Datadog, Inc.

package datadogV2

import (
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// FindingDetectionType The detection type of the finding.
type FindingDetectionType string

// List of FindingDetectionType.
const (
FINDINGDETECTIONTYPE_MISCONFIGURATION FindingDetectionType = "misconfiguration"
FINDINGDETECTIONTYPE_ATTACK_PATH FindingDetectionType = "attack_path"
FINDINGDETECTIONTYPE_IDENTITY_RISK FindingDetectionType = "identity_risk"
FINDINGDETECTIONTYPE_API_SECURITY FindingDetectionType = "api_security"
)

var allowedFindingDetectionTypeEnumValues = []FindingDetectionType{
FINDINGDETECTIONTYPE_MISCONFIGURATION,
FINDINGDETECTIONTYPE_ATTACK_PATH,
FINDINGDETECTIONTYPE_IDENTITY_RISK,
FINDINGDETECTIONTYPE_API_SECURITY,
}

// GetAllowedValues reeturns the list of possible values.
func (v *FindingDetectionType) GetAllowedValues() []FindingDetectionType {
return allowedFindingDetectionTypeEnumValues
}

// UnmarshalJSON deserializes the given payload.
func (v *FindingDetectionType) UnmarshalJSON(src []byte) error {
var value string
err := datadog.Unmarshal(src, &value)
if err != nil {
return err
}
*v = FindingDetectionType(value)
return nil
}

// NewFindingDetectionTypeFromValue returns a pointer to a valid FindingDetectionType
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
func NewFindingDetectionTypeFromValue(v string) (*FindingDetectionType, error) {
ev := FindingDetectionType(v)
if ev.IsValid() {
return &ev, nil
}
return nil, fmt.Errorf("invalid value '%v' for FindingDetectionType: valid values are %v", v, allowedFindingDetectionTypeEnumValues)
}

// IsValid return true if the value is valid for the enum, false otherwise.
func (v FindingDetectionType) IsValid() bool {
for _, existing := range allowedFindingDetectionTypeEnumValues {
if existing == v {
return true
}
}
return false
}

// Ptr returns reference to FindingDetectionType value.
func (v FindingDetectionType) Ptr() *FindingDetectionType {
return &v
}

0 comments on commit 0c9be82

Please sign in to comment.