Skip to content

Commit bc3b0d2

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add API Key ID to rum application response (#3377)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 18cff9d commit bc3b0d2

2 files changed

Lines changed: 42 additions & 1 deletion

File tree

.generator/schemas/v2/openapi.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35837,6 +35837,12 @@ components:
3583735837
RUMApplicationAttributes:
3583835838
description: RUM application attributes.
3583935839
properties:
35840+
api_key_id:
35841+
description: ID of the API key associated with the application.
35842+
example: 123456789
35843+
format: int32
35844+
maximum: 2147483647
35845+
type: integer
3584035846
application_id:
3584135847
description: ID of the RUM application.
3584235848
example: abcd1234-0000-0000-abcd-1234abcd5678

api/datadogV2/model_rum_application_attributes.go

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import (
1212

1313
// RUMApplicationAttributes RUM application attributes.
1414
type RUMApplicationAttributes struct {
15+
// ID of the API key associated with the application.
16+
ApiKeyId *int32 `json:"api_key_id,omitempty"`
1517
// ID of the RUM application.
1618
ApplicationId string `json:"application_id"`
1719
// Client token of the RUM application.
@@ -67,6 +69,34 @@ func NewRUMApplicationAttributesWithDefaults() *RUMApplicationAttributes {
6769
return &this
6870
}
6971

72+
// GetApiKeyId returns the ApiKeyId field value if set, zero value otherwise.
73+
func (o *RUMApplicationAttributes) GetApiKeyId() int32 {
74+
if o == nil || o.ApiKeyId == nil {
75+
var ret int32
76+
return ret
77+
}
78+
return *o.ApiKeyId
79+
}
80+
81+
// GetApiKeyIdOk returns a tuple with the ApiKeyId field value if set, nil otherwise
82+
// and a boolean to check if the value has been set.
83+
func (o *RUMApplicationAttributes) GetApiKeyIdOk() (*int32, bool) {
84+
if o == nil || o.ApiKeyId == nil {
85+
return nil, false
86+
}
87+
return o.ApiKeyId, true
88+
}
89+
90+
// HasApiKeyId returns a boolean if a field has been set.
91+
func (o *RUMApplicationAttributes) HasApiKeyId() bool {
92+
return o != nil && o.ApiKeyId != nil
93+
}
94+
95+
// SetApiKeyId gets a reference to the given int32 and assigns it to the ApiKeyId field.
96+
func (o *RUMApplicationAttributes) SetApiKeyId(v int32) {
97+
o.ApiKeyId = &v
98+
}
99+
70100
// GetApplicationId returns the ApplicationId field value.
71101
func (o *RUMApplicationAttributes) GetApplicationId() string {
72102
if o == nil {
@@ -364,6 +394,9 @@ func (o RUMApplicationAttributes) MarshalJSON() ([]byte, error) {
364394
if o.UnparsedObject != nil {
365395
return datadog.Marshal(o.UnparsedObject)
366396
}
397+
if o.ApiKeyId != nil {
398+
toSerialize["api_key_id"] = o.ApiKeyId
399+
}
367400
toSerialize["application_id"] = o.ApplicationId
368401
toSerialize["client_token"] = o.ClientToken
369402
toSerialize["created_at"] = o.CreatedAt
@@ -392,6 +425,7 @@ func (o RUMApplicationAttributes) MarshalJSON() ([]byte, error) {
392425
// UnmarshalJSON deserializes the given payload.
393426
func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
394427
all := struct {
428+
ApiKeyId *int32 `json:"api_key_id,omitempty"`
395429
ApplicationId *string `json:"application_id"`
396430
ClientToken *string `json:"client_token"`
397431
CreatedAt *int64 `json:"created_at"`
@@ -437,12 +471,13 @@ func (o *RUMApplicationAttributes) UnmarshalJSON(bytes []byte) (err error) {
437471
}
438472
additionalProperties := make(map[string]interface{})
439473
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
440-
datadog.DeleteKeys(additionalProperties, &[]string{"application_id", "client_token", "created_at", "created_by_handle", "hash", "is_active", "name", "org_id", "product_scales", "type", "updated_at", "updated_by_handle"})
474+
datadog.DeleteKeys(additionalProperties, &[]string{"api_key_id", "application_id", "client_token", "created_at", "created_by_handle", "hash", "is_active", "name", "org_id", "product_scales", "type", "updated_at", "updated_by_handle"})
441475
} else {
442476
return err
443477
}
444478

445479
hasInvalidField := false
480+
o.ApiKeyId = all.ApiKeyId
446481
o.ApplicationId = *all.ApplicationId
447482
o.ClientToken = *all.ClientToken
448483
o.CreatedAt = *all.CreatedAt

0 commit comments

Comments
 (0)