Skip to content

Commit 9952588

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 9ebecac of spec repo (#4221)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 50d3dea commit 9952588

8 files changed

Lines changed: 416 additions & 5 deletions

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31464,9 +31464,10 @@ components:
3146431464
additionalProperties: {}
3146531465
description: The set of attributes recorded for the entity at this revision. The keys depend on the kind of entity.
3146631466
example:
31467+
accounts:
31468+
- linked-account-123
3146731469
display_name: Test User
31468-
emails:
31469-
- user@example.com
31470+
email: user@example.com
3147031471
principal_id: user@example.com
3147131472
type: object
3147231473
EntityData:
@@ -88286,6 +88287,14 @@ components:
8828688287
type: string
8828788288
x-enum-varnames:
8828888289
- AGGREGATED_DNS
88290+
SingleEntityContextResponse:
88291+
description: Response from the single entity context endpoint, containing the matching entity.
88292+
properties:
88293+
data:
88294+
$ref: "#/components/schemas/EntityContextEntity"
88295+
required:
88296+
- data
88297+
type: object
8828988298
SlackIntegrationMetadata:
8829088299
description: Incident integration metadata for the Slack integration.
8829188300
properties:
@@ -166474,9 +166483,10 @@ paths:
166474166483
- attributes:
166475166484
revisions:
166476166485
- attributes:
166486+
accounts:
166487+
- linked-account-123
166477166488
display_name: Test User
166478-
emails:
166479-
- user@example.com
166489+
email: user@example.com
166480166490
principal_id: user@example.com
166481166491
first_seen_at: "2026-04-01T00:00:00Z"
166482166492
last_seen_at: "2026-05-01T00:00:00Z"
@@ -166507,7 +166517,98 @@ paths:
166507166517
permissions:
166508166518
- siem_entities_read
166509166519
x-unstable: |-
166510-
**Note**: This endpoint is in preview and is subject to change.
166520+
**Note**: This endpoint is in Preview and is subject to change.
166521+
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
166522+
/api/v2/security_monitoring/entity_context/{id}:
166523+
get:
166524+
description: |-
166525+
Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical
166526+
revisions of the entity in the requested time range. The endpoint can either return revisions across an
166527+
interval (`from` / `to`) or the snapshot of the entity at a single point in time (`as_of`); the two modes
166528+
are mutually exclusive.
166529+
operationId: GetSingleEntityContext
166530+
parameters:
166531+
- description: The unique identifier of the entity to retrieve.
166532+
in: path
166533+
name: id
166534+
required: true
166535+
schema:
166536+
example: user@example.com
166537+
type: string
166538+
- description: |-
166539+
The start of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now-7d`).
166540+
Defaults to `now-7d`. Ignored when `as_of` is set.
166541+
in: query
166542+
name: from
166543+
required: false
166544+
schema:
166545+
default: now-7d
166546+
example: now-7d
166547+
type: string
166548+
- description: |-
166549+
The end of the time range to query, as an RFC3339 timestamp or a relative time (for example, `now`).
166550+
Defaults to `now`. Ignored when `as_of` is set.
166551+
in: query
166552+
name: to
166553+
required: false
166554+
schema:
166555+
default: now
166556+
example: now
166557+
type: string
166558+
- description: |-
166559+
A point in time at which to query the entity revisions, as an RFC3339 timestamp, a Unix timestamp
166560+
(in seconds), or a relative time (for example, `now-1d`). When set, `from` and `to` are ignored.
166561+
Cannot be combined with custom `from` / `to` values.
166562+
example: now-1d
166563+
in: query
166564+
name: as_of
166565+
required: false
166566+
schema:
166567+
type: string
166568+
responses:
166569+
"200":
166570+
content:
166571+
application/json:
166572+
examples:
166573+
default:
166574+
value:
166575+
data:
166576+
attributes:
166577+
revisions:
166578+
- attributes:
166579+
accounts:
166580+
- linked-account-123
166581+
display_name: Test User
166582+
email: user@example.com
166583+
principal_id: user@example.com
166584+
first_seen_at: "2026-04-01T00:00:00Z"
166585+
last_seen_at: "2026-05-01T00:00:00Z"
166586+
id: user@example.com
166587+
type: siem_entity_identity
166588+
schema:
166589+
$ref: "#/components/schemas/SingleEntityContextResponse"
166590+
description: OK
166591+
"400":
166592+
$ref: "#/components/responses/BadRequestResponse"
166593+
"403":
166594+
$ref: "#/components/responses/NotAuthorizedResponse"
166595+
"404":
166596+
$ref: "#/components/responses/NotFoundResponse"
166597+
"429":
166598+
$ref: "#/components/responses/TooManyRequestsResponse"
166599+
security:
166600+
- apiKeyAuth: []
166601+
appKeyAuth: []
166602+
- AuthZ:
166603+
- siem_entities_read
166604+
summary: Get a single entity context
166605+
tags: ["Security Monitoring"]
166606+
x-permission:
166607+
operator: OR
166608+
permissions:
166609+
- siem_entities_read
166610+
x-unstable: |-
166611+
**Note**: This endpoint is in Preview and is subject to change.
166511166612
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
166512166613
/api/v2/security_monitoring/rules:
166513166614
get:

api/datadog/configuration.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ func NewConfiguration() *Configuration {
825825
"v2.GetSecurityMonitoringHistsignalsByJobId": false,
826826
"v2.GetSecurityMonitoringIntegrationConfig": false,
827827
"v2.GetSignalEntities": false,
828+
"v2.GetSingleEntityContext": false,
828829
"v2.GetStaticAnalysisDefaultRulesets": false,
829830
"v2.GetStaticAnalysisNodeTypes": false,
830831
"v2.GetStaticAnalysisRuleset": false,

api/datadogV2/api_security_monitoring.go

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6835,6 +6835,144 @@ func (a *SecurityMonitoringApi) GetSignalNotificationRules(ctx _context.Context)
68356835
return localVarReturnValue, localVarHTTPResponse, nil
68366836
}
68376837

6838+
// GetSingleEntityContextOptionalParameters holds optional parameters for GetSingleEntityContext.
6839+
type GetSingleEntityContextOptionalParameters struct {
6840+
From *string
6841+
To *string
6842+
AsOf *string
6843+
}
6844+
6845+
// NewGetSingleEntityContextOptionalParameters creates an empty struct for parameters.
6846+
func NewGetSingleEntityContextOptionalParameters() *GetSingleEntityContextOptionalParameters {
6847+
this := GetSingleEntityContextOptionalParameters{}
6848+
return &this
6849+
}
6850+
6851+
// WithFrom sets the corresponding parameter name and returns the struct.
6852+
func (r *GetSingleEntityContextOptionalParameters) WithFrom(from string) *GetSingleEntityContextOptionalParameters {
6853+
r.From = &from
6854+
return r
6855+
}
6856+
6857+
// WithTo sets the corresponding parameter name and returns the struct.
6858+
func (r *GetSingleEntityContextOptionalParameters) WithTo(to string) *GetSingleEntityContextOptionalParameters {
6859+
r.To = &to
6860+
return r
6861+
}
6862+
6863+
// WithAsOf sets the corresponding parameter name and returns the struct.
6864+
func (r *GetSingleEntityContextOptionalParameters) WithAsOf(asOf string) *GetSingleEntityContextOptionalParameters {
6865+
r.AsOf = &asOf
6866+
return r
6867+
}
6868+
6869+
// GetSingleEntityContext Get a single entity context.
6870+
// Get a single entity from the Cloud SIEM entity context store by its identifier, returning the historical
6871+
// revisions of the entity in the requested time range. The endpoint can either return revisions across an
6872+
// interval (`from` / `to`) or the snapshot of the entity at a single point in time (`as_of`); the two modes
6873+
// are mutually exclusive.
6874+
func (a *SecurityMonitoringApi) GetSingleEntityContext(ctx _context.Context, id string, o ...GetSingleEntityContextOptionalParameters) (SingleEntityContextResponse, *_nethttp.Response, error) {
6875+
var (
6876+
localVarHTTPMethod = _nethttp.MethodGet
6877+
localVarPostBody interface{}
6878+
localVarReturnValue SingleEntityContextResponse
6879+
optionalParams GetSingleEntityContextOptionalParameters
6880+
)
6881+
6882+
if len(o) > 1 {
6883+
return localVarReturnValue, nil, datadog.ReportError("only one argument of type GetSingleEntityContextOptionalParameters is allowed")
6884+
}
6885+
if len(o) == 1 {
6886+
optionalParams = o[0]
6887+
}
6888+
6889+
operationId := "v2.GetSingleEntityContext"
6890+
isOperationEnabled := a.Client.Cfg.IsUnstableOperationEnabled(operationId)
6891+
if !isOperationEnabled {
6892+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: _fmt.Sprintf("Unstable operation '%s' is disabled", operationId)}
6893+
}
6894+
if isOperationEnabled && a.Client.Cfg.Debug {
6895+
_log.Printf("WARNING: Using unstable operation '%s'", operationId)
6896+
}
6897+
6898+
localBasePath, err := a.Client.Cfg.ServerURLWithContext(ctx, "v2.SecurityMonitoringApi.GetSingleEntityContext")
6899+
if err != nil {
6900+
return localVarReturnValue, nil, datadog.GenericOpenAPIError{ErrorMessage: err.Error()}
6901+
}
6902+
6903+
localVarPath := localBasePath + "/api/v2/security_monitoring/entity_context/{id}"
6904+
localVarPath = datadog.ReplacePathParameter(localVarPath, "{id}", _neturl.PathEscape(datadog.ParameterToString(id, "")))
6905+
6906+
localVarHeaderParams := make(map[string]string)
6907+
localVarQueryParams := _neturl.Values{}
6908+
localVarFormParams := _neturl.Values{}
6909+
if optionalParams.From != nil {
6910+
localVarQueryParams.Add("from", datadog.ParameterToString(*optionalParams.From, ""))
6911+
}
6912+
if optionalParams.To != nil {
6913+
localVarQueryParams.Add("to", datadog.ParameterToString(*optionalParams.To, ""))
6914+
}
6915+
if optionalParams.AsOf != nil {
6916+
localVarQueryParams.Add("as_of", datadog.ParameterToString(*optionalParams.AsOf, ""))
6917+
}
6918+
localVarHeaderParams["Accept"] = "application/json"
6919+
6920+
if a.Client.Cfg.DelegatedTokenConfig != nil {
6921+
err = datadog.UseDelegatedTokenAuth(ctx, &localVarHeaderParams, a.Client.Cfg.DelegatedTokenConfig)
6922+
if err != nil {
6923+
return localVarReturnValue, nil, err
6924+
}
6925+
} else {
6926+
datadog.SetAuthKeys(
6927+
ctx,
6928+
&localVarHeaderParams,
6929+
[2]string{"apiKeyAuth", "DD-API-KEY"},
6930+
[2]string{"appKeyAuth", "DD-APPLICATION-KEY"},
6931+
)
6932+
}
6933+
req, err := a.Client.PrepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, nil)
6934+
if err != nil {
6935+
return localVarReturnValue, nil, err
6936+
}
6937+
6938+
localVarHTTPResponse, err := a.Client.CallAPI(req)
6939+
if err != nil || localVarHTTPResponse == nil {
6940+
return localVarReturnValue, localVarHTTPResponse, err
6941+
}
6942+
6943+
localVarBody, err := datadog.ReadBody(localVarHTTPResponse)
6944+
if err != nil {
6945+
return localVarReturnValue, localVarHTTPResponse, err
6946+
}
6947+
6948+
if localVarHTTPResponse.StatusCode >= 300 {
6949+
newErr := datadog.GenericOpenAPIError{
6950+
ErrorBody: localVarBody,
6951+
ErrorMessage: localVarHTTPResponse.Status,
6952+
}
6953+
if localVarHTTPResponse.StatusCode == 400 || localVarHTTPResponse.StatusCode == 403 || localVarHTTPResponse.StatusCode == 404 || localVarHTTPResponse.StatusCode == 429 {
6954+
var v APIErrorResponse
6955+
err = a.Client.Decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
6956+
if err != nil {
6957+
return localVarReturnValue, localVarHTTPResponse, newErr
6958+
}
6959+
newErr.ErrorModel = v
6960+
}
6961+
return localVarReturnValue, localVarHTTPResponse, newErr
6962+
}
6963+
6964+
err = a.Client.Decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
6965+
if err != nil {
6966+
newErr := datadog.GenericOpenAPIError{
6967+
ErrorBody: localVarBody,
6968+
ErrorMessage: err.Error(),
6969+
}
6970+
return localVarReturnValue, localVarHTTPResponse, newErr
6971+
}
6972+
6973+
return localVarReturnValue, localVarHTTPResponse, nil
6974+
}
6975+
68386976
// GetStaticAnalysisDefaultRulesets Get default rulesets for a language.
68396977
// Get the default SAST ruleset names for a given programming language.
68406978
func (a *SecurityMonitoringApi) GetStaticAnalysisDefaultRulesets(ctx _context.Context, language string) (DefaultRulesetsPerLanguageResponse, *_nethttp.Response, error) {

api/datadogV2/doc.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,7 @@
10131013
// - [SecurityMonitoringApi.GetSignalEntities]
10141014
// - [SecurityMonitoringApi.GetSignalNotificationRule]
10151015
// - [SecurityMonitoringApi.GetSignalNotificationRules]
1016+
// - [SecurityMonitoringApi.GetSingleEntityContext]
10161017
// - [SecurityMonitoringApi.GetStaticAnalysisDefaultRulesets]
10171018
// - [SecurityMonitoringApi.GetStaticAnalysisNodeTypes]
10181019
// - [SecurityMonitoringApi.GetStaticAnalysisRuleset]

0 commit comments

Comments
 (0)