Skip to content

Commit 711b9fb

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add examples to Reference Tables API documentation, update cloud file and local file metadata (#3443)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 348cda3 commit 711b9fb

File tree

48 files changed

+345
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+345
-559
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 181 additions & 152 deletions
Large diffs are not rendered by default.

api/datadogV2/api_reference_tables.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ import (
1717
type ReferenceTablesApi datadog.Service
1818

1919
// CreateReferenceTable Create reference table.
20-
// Create a new reference table. You can provide data in two ways: 1) Call POST api/v2/reference-tables/upload first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this POST endpoint with the upload_id in file_metadata, OR 2) Provide access_details in file_metadata pointing to a CSV file in cloud storage (Amazon S3, Azure Blob Storage, or GCP Cloud Storage).
20+
// Creates a reference table. You can provide data in two ways:
21+
// 1. Call POST /api/v2/reference-tables/upload to get an upload ID. Then, PUT the CSV data
22+
// (not the file itself) in chunks to each URL in the request body. Finally, call this
23+
// POST endpoint with `upload_id` in `file_metadata`.
24+
// 2. Provide `access_details` in `file_metadata` pointing to a CSV file in cloud storage.
2125
func (a *ReferenceTablesApi) CreateReferenceTable(ctx _context.Context, body CreateTableRequest) (TableResultV2, *_nethttp.Response, error) {
2226
var (
2327
localVarHTTPMethod = _nethttp.MethodPost

api/datadogV2/model_create_table_request.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// CreateTableRequest The definition of `CreateTableRequest` object.
11+
// CreateTableRequest Request body for creating a new reference table from a local file or cloud storage.
1212
type CreateTableRequest struct {
13-
// The definition of `CreateTableRequestData` object.
13+
// The data object containing the table definition.
1414
Data *CreateTableRequestData `json:"data,omitempty"`
1515
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1616
UnparsedObject map[string]interface{} `json:"-"`

api/datadogV2/model_create_table_request_data.go

Lines changed: 3 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,14 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// CreateTableRequestData The definition of `CreateTableRequestData` object.
13+
// CreateTableRequestData The data object containing the table definition.
1414
type CreateTableRequestData struct {
15-
// The definition of `CreateTableRequestDataAttributes` object.
15+
// Attributes that define the reference table's configuration and properties.
1616
Attributes *CreateTableRequestDataAttributes `json:"attributes,omitempty"`
17-
// The ID of the reference table.
18-
Id *string `json:"id,omitempty"`
1917
// Reference table resource type.
2018
Type CreateTableRequestDataType `json:"type"`
2119
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
22-
UnparsedObject map[string]interface{} `json:"-"`
23-
AdditionalProperties map[string]interface{} `json:"-"`
20+
UnparsedObject map[string]interface{} `json:"-"`
2421
}
2522

2623
// NewCreateTableRequestData instantiates a new CreateTableRequestData object.
@@ -71,34 +68,6 @@ func (o *CreateTableRequestData) SetAttributes(v CreateTableRequestDataAttribute
7168
o.Attributes = &v
7269
}
7370

74-
// GetId returns the Id field value if set, zero value otherwise.
75-
func (o *CreateTableRequestData) GetId() string {
76-
if o == nil || o.Id == nil {
77-
var ret string
78-
return ret
79-
}
80-
return *o.Id
81-
}
82-
83-
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
84-
// and a boolean to check if the value has been set.
85-
func (o *CreateTableRequestData) GetIdOk() (*string, bool) {
86-
if o == nil || o.Id == nil {
87-
return nil, false
88-
}
89-
return o.Id, true
90-
}
91-
92-
// HasId returns a boolean if a field has been set.
93-
func (o *CreateTableRequestData) HasId() bool {
94-
return o != nil && o.Id != nil
95-
}
96-
97-
// SetId gets a reference to the given string and assigns it to the Id field.
98-
func (o *CreateTableRequestData) SetId(v string) {
99-
o.Id = &v
100-
}
101-
10271
// GetType returns the Type field value.
10372
func (o *CreateTableRequestData) GetType() CreateTableRequestDataType {
10473
if o == nil {
@@ -131,22 +100,14 @@ func (o CreateTableRequestData) MarshalJSON() ([]byte, error) {
131100
if o.Attributes != nil {
132101
toSerialize["attributes"] = o.Attributes
133102
}
134-
if o.Id != nil {
135-
toSerialize["id"] = o.Id
136-
}
137103
toSerialize["type"] = o.Type
138-
139-
for key, value := range o.AdditionalProperties {
140-
toSerialize[key] = value
141-
}
142104
return datadog.Marshal(toSerialize)
143105
}
144106

145107
// UnmarshalJSON deserializes the given payload.
146108
func (o *CreateTableRequestData) UnmarshalJSON(bytes []byte) (err error) {
147109
all := struct {
148110
Attributes *CreateTableRequestDataAttributes `json:"attributes,omitempty"`
149-
Id *string `json:"id,omitempty"`
150111
Type *CreateTableRequestDataType `json:"type"`
151112
}{}
152113
if err = datadog.Unmarshal(bytes, &all); err != nil {
@@ -155,29 +116,18 @@ func (o *CreateTableRequestData) UnmarshalJSON(bytes []byte) (err error) {
155116
if all.Type == nil {
156117
return fmt.Errorf("required field type missing")
157118
}
158-
additionalProperties := make(map[string]interface{})
159-
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
160-
datadog.DeleteKeys(additionalProperties, &[]string{"attributes", "id", "type"})
161-
} else {
162-
return err
163-
}
164119

165120
hasInvalidField := false
166121
if all.Attributes != nil && all.Attributes.UnparsedObject != nil && o.UnparsedObject == nil {
167122
hasInvalidField = true
168123
}
169124
o.Attributes = all.Attributes
170-
o.Id = all.Id
171125
if !all.Type.IsValid() {
172126
hasInvalidField = true
173127
} else {
174128
o.Type = *all.Type
175129
}
176130

177-
if len(additionalProperties) > 0 {
178-
o.AdditionalProperties = additionalProperties
179-
}
180-
181131
if hasInvalidField {
182132
return datadog.Unmarshal(bytes, &o.UnparsedObject)
183133
}

api/datadogV2/model_create_table_request_data_attributes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// CreateTableRequestDataAttributes The definition of `CreateTableRequestDataAttributes` object.
13+
// CreateTableRequestDataAttributes Attributes that define the reference table's configuration and properties.
1414
type CreateTableRequestDataAttributes struct {
15-
// The description of the reference table.
15+
// Optional text describing the purpose or contents of this reference table.
1616
Description *string `json:"description,omitempty"`
17-
// The definition of `CreateTableRequestDataAttributesFileMetadata` object.
17+
// Metadata specifying where and how to access the reference table's data file.
1818
FileMetadata *CreateTableRequestDataAttributesFileMetadata `json:"file_metadata,omitempty"`
19-
// The definition of `CreateTableRequestDataAttributesSchema` object.
19+
// Schema defining the structure and columns of the reference table.
2020
Schema CreateTableRequestDataAttributesSchema `json:"schema"`
2121
// The source type for creating reference table data. Only these source types can be created through this API.
2222
Source ReferenceTableCreateSourceType `json:"source"`
23-
// The name of the reference table.
23+
// Name to identify this reference table.
2424
TableName string `json:"table_name"`
25-
// The tags of the reference table.
25+
// Tags for organizing and filtering reference tables.
2626
Tags []string `json:"tags,omitempty"`
2727
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2828
UnparsedObject map[string]interface{} `json:"-"`

api/datadogV2/model_create_table_request_data_attributes_file_metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// CreateTableRequestDataAttributesFileMetadata - The definition of `CreateTableRequestDataAttributesFileMetadata` object.
11+
// CreateTableRequestDataAttributesFileMetadata - Metadata specifying where and how to access the reference table's data file.
1212
type CreateTableRequestDataAttributesFileMetadata struct {
1313
CreateTableRequestDataAttributesFileMetadataCloudStorage *CreateTableRequestDataAttributesFileMetadataCloudStorage
1414
CreateTableRequestDataAttributesFileMetadataLocalFile *CreateTableRequestDataAttributesFileMetadataLocalFile

api/datadogV2/model_create_table_request_data_attributes_file_metadata_cloud_storage.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
// CreateTableRequestDataAttributesFileMetadataCloudStorage Cloud storage file metadata for create requests. Both access_details and sync_enabled are required.
1414
type CreateTableRequestDataAttributesFileMetadataCloudStorage struct {
15-
// The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
15+
// Cloud storage access configuration for the reference table data file.
1616
AccessDetails CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails `json:"access_details"`
1717
// Whether this table is synced automatically.
1818
SyncEnabled bool `json:"sync_enabled"`

api/datadogV2/model_create_table_request_data_attributes_file_metadata_one_of_access_details.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import (
88
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
99
)
1010

11-
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
11+
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails Cloud storage access configuration for the reference table data file.
1212
type CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails struct {
13-
// The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object.
13+
// Amazon Web Services S3 storage access configuration.
1414
AwsDetail *CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail `json:"aws_detail,omitempty"`
15-
// The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object.
15+
// Azure Blob Storage access configuration.
1616
AzureDetail *CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail `json:"azure_detail,omitempty"`
17-
// The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object.
17+
// Google Cloud Platform storage access configuration.
1818
GcpDetail *CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail `json:"gcp_detail,omitempty"`
1919
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2020
UnparsedObject map[string]interface{} `json:"-"`

api/datadogV2/model_create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object.
13+
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail Amazon Web Services S3 storage access configuration.
1414
type CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail struct {
15-
// The ID of the AWS account.
15+
// AWS account ID where the S3 bucket is located.
1616
AwsAccountId string `json:"aws_account_id"`
17-
// The name of the Amazon S3 bucket.
17+
// S3 bucket containing the CSV file.
1818
AwsBucketName string `json:"aws_bucket_name"`
1919
// The relative file path from the S3 bucket root to the CSV file.
2020
FilePath string `json:"file_path"`

api/datadogV2/model_create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import (
1010
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
1111
)
1212

13-
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object.
13+
// CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail Azure Blob Storage access configuration.
1414
type CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail struct {
15-
// The Azure client ID.
15+
// Azure service principal (application) client ID with permissions to read from the container.
1616
AzureClientId string `json:"azure_client_id"`
17-
// The name of the Azure container.
17+
// Azure Blob Storage container containing the CSV file.
1818
AzureContainerName string `json:"azure_container_name"`
19-
// The name of the Azure storage account.
19+
// Azure storage account where the container is located.
2020
AzureStorageAccountName string `json:"azure_storage_account_name"`
21-
// The ID of the Azure tenant.
21+
// Azure Active Directory tenant ID.
2222
AzureTenantId string `json:"azure_tenant_id"`
2323
// The relative file path from the Azure container root to the CSV file.
2424
FilePath string `json:"file_path"`

0 commit comments

Comments
 (0)