Skip to content
Open
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
5 changes: 0 additions & 5 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38611,7 +38611,6 @@ components:
type: STRING
primary_keys:
- id
sync_enabled: false
tags:
- test_tag
type: reference_table
Expand Down Expand Up @@ -38643,10 +38642,6 @@ components:
$ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadata'
schema:
$ref: '#/components/schemas/PatchTableRequestDataAttributesSchema'
sync_enabled:
description: Whether this table is synced automatically.
example: false
type: boolean
tags:
description: Tags for organizing and filtering reference tables.
example:
Expand Down
37 changes: 1 addition & 36 deletions api/datadogV2/model_patch_table_request_data_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ type PatchTableRequestDataAttributes struct {
FileMetadata *PatchTableRequestDataAttributesFileMetadata `json:"file_metadata,omitempty"`
// Schema defining the updates to the structure and columns of the reference table. Schema fields cannot be deleted or renamed.
Schema *PatchTableRequestDataAttributesSchema `json:"schema,omitempty"`
// Whether this table is synced automatically.
SyncEnabled *bool `json:"sync_enabled,omitempty"`
// Tags for organizing and filtering reference tables.
Tags []string `json:"tags,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -126,34 +124,6 @@ func (o *PatchTableRequestDataAttributes) SetSchema(v PatchTableRequestDataAttri
o.Schema = &v
}

// GetSyncEnabled returns the SyncEnabled field value if set, zero value otherwise.
func (o *PatchTableRequestDataAttributes) GetSyncEnabled() bool {
if o == nil || o.SyncEnabled == nil {
var ret bool
return ret
}
return *o.SyncEnabled
}

// GetSyncEnabledOk returns a tuple with the SyncEnabled field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PatchTableRequestDataAttributes) GetSyncEnabledOk() (*bool, bool) {
if o == nil || o.SyncEnabled == nil {
return nil, false
}
return o.SyncEnabled, true
}

// HasSyncEnabled returns a boolean if a field has been set.
func (o *PatchTableRequestDataAttributes) HasSyncEnabled() bool {
return o != nil && o.SyncEnabled != nil
}

// SetSyncEnabled gets a reference to the given bool and assigns it to the SyncEnabled field.
func (o *PatchTableRequestDataAttributes) SetSyncEnabled(v bool) {
o.SyncEnabled = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *PatchTableRequestDataAttributes) GetTags() []string {
if o == nil || o.Tags == nil {
Expand Down Expand Up @@ -197,9 +167,6 @@ func (o PatchTableRequestDataAttributes) MarshalJSON() ([]byte, error) {
if o.Schema != nil {
toSerialize["schema"] = o.Schema
}
if o.SyncEnabled != nil {
toSerialize["sync_enabled"] = o.SyncEnabled
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
Expand All @@ -216,15 +183,14 @@ func (o *PatchTableRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error
Description *string `json:"description,omitempty"`
FileMetadata *PatchTableRequestDataAttributesFileMetadata `json:"file_metadata,omitempty"`
Schema *PatchTableRequestDataAttributesSchema `json:"schema,omitempty"`
SyncEnabled *bool `json:"sync_enabled,omitempty"`
Tags []string `json:"tags,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"description", "file_metadata", "schema", "sync_enabled", "tags"})
datadog.DeleteKeys(additionalProperties, &[]string{"description", "file_metadata", "schema", "tags"})
} else {
return err
}
Expand All @@ -236,7 +202,6 @@ func (o *PatchTableRequestDataAttributes) UnmarshalJSON(bytes []byte) (err error
hasInvalidField = true
}
o.Schema = all.Schema
o.SyncEnabled = all.SyncEnabled
o.Tags = all.Tags

if len(additionalProperties) > 0 {
Expand Down
1 change: 0 additions & 1 deletion examples/v2/reference-tables/UpdateReferenceTable.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func main() {
"id",
},
},
SyncEnabled: datadog.PtrBool(false),
Tags: []string{
"test_tag",
},
Expand Down
4 changes: 2 additions & 2 deletions tests/scenarios/features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ Feature: Reference Tables
Scenario: Update reference table returns "Bad Request" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "type": "reference_table"}}
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/redapl-experiences
Scenario: Update reference table returns "OK" response
Given new "UpdateReferenceTable" request
And request contains "id" parameter from "REPLACE.ME"
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "type": "reference_table"}}
And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "tags": ["test_tag"]}, "type": "reference_table"}}
When the request is sent
Then the response status is 200 OK