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
306 changes: 163 additions & 143 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion examples/v2/reference-tables/UpdateReferenceTable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"test_tag",
],
}),
id: "00000000-0000-0000-0000-000000000000",
type: DatadogAPIClient::V2::PatchTableRequestDataType::REFERENCE_TABLE,
}),
})
Expand Down
2 changes: 1 addition & 1 deletion features/v2/reference_tables.feature
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Feature: Reference Tables
@generated @skip @team:DataDog/redapl-experiences
Scenario: Create reference table upload returns "Bad Request" response
Given new "CreateReferenceTableUpload" request
And body with value {"data": {"attributes": {"headers": [""], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}}
And body with value {"data": {"attributes": {"headers": ["field_1", "field_2"], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}}
When the request is sent
Then the response status is 400 Bad Request

Expand Down
16 changes: 10 additions & 6 deletions lib/datadog_api_client/v2/api/reference_tables_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ def create_reference_table(body, opts = {})

# Create reference table.
#
# 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).
# Creates a reference table. You can provide data in two ways:
# 1. Call POST /api/v2/reference-tables/upload to get an upload ID. Then PUT the CSV data
# (not the file itself) in chunks to each URL in the request body. Finally, call this
# POST endpoint with `upload_id` in `file_metadata`.
# 2. Provide `access_details` in `file_metadata` pointing to a CSV file in cloud storage.
#
# @param body [CreateTableRequest]
# @param opts [Hash] the optional parameters
Expand Down Expand Up @@ -169,7 +173,7 @@ def delete_table(id, opts = {})
#
# Delete a reference table by ID
#
# @param id [String] The ID of the reference table to delete
# @param id [String] Unique identifier of the reference table to delete
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
def delete_table_with_http_info(id, opts = {})
Expand Down Expand Up @@ -234,7 +238,7 @@ def get_rows_by_id(id, row_id, opts = {})
#
# Get reference table rows by their primary key values.
#
# @param id [String] The ID of the reference table
# @param id [String] Unique identifier of the reference table to get rows from
# @param row_id [Array<String>] List of row IDs (primary key values) to retrieve from the reference table.
# @param opts [Hash] the optional parameters
# @return [Array<(TableRowResourceArray, Integer, Hash)>] TableRowResourceArray data, response status code and response headers
Expand Down Expand Up @@ -306,7 +310,7 @@ def get_table(id, opts = {})
#
# Get a reference table by ID
#
# @param id [String] The ID of the reference table to retrieve
# @param id [String] Unique identifier of the reference table to retrieve
# @param opts [Hash] the optional parameters
# @return [Array<(TableResultV2, Integer, Hash)>] TableResultV2 data, response status code and response headers
def get_table_with_http_info(id, opts = {})
Expand Down Expand Up @@ -374,7 +378,7 @@ def list_tables(opts = {})
# @param opts [Hash] the optional parameters
# @option opts [Integer] :page_limit Number of tables to return.
# @option opts [Integer] :page_offset Number of tables to skip for pagination.
# @option opts [ReferenceTableSortType] :sort Sort field and direction. Use field name for ascending, prefix with "-" for descending.
# @option opts [ReferenceTableSortType] :sort Sort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending.
# @option opts [String] :filter_status Filter by table status.
# @option opts [String] :filter_table_name_exact Filter by exact table name match.
# @option opts [String] :filter_table_name_contains Filter by table name containing substring.
Expand Down Expand Up @@ -456,7 +460,7 @@ def update_reference_table(id, body, opts = {})
#
# Update a reference table by ID. You can update the table's data, description, and tags. Note: The source type cannot be changed after table creation. For data updates: For existing tables of type `source:LOCAL_FILE`, call POST api/v2/reference-tables/uploads first to get an upload ID, then PUT chunks of CSV data to each provided URL, and finally call this PATCH endpoint with the upload_id in file_metadata. For existing tables with `source:` types of `S3`, `GCS`, or `AZURE`, provide updated access_details in file_metadata pointing to a CSV file in the same type of cloud storage.
#
# @param id [String] The ID of the reference table to update
# @param id [String] Unique identifier of the reference table to update
# @param body [PatchTableRequest]
# @param opts [Hash] the optional parameters
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
Expand Down
4 changes: 2 additions & 2 deletions lib/datadog_api_client/v2/models/create_table_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequest` object.
# Request body for creating a new reference table from a local file or cloud storage.
class CreateTableRequest
include BaseGenericModel

# The definition of `CreateTableRequestData` object.
# The data object containing the table definition.
attr_accessor :data

attr_accessor :additional_properties
Expand Down
16 changes: 3 additions & 13 deletions lib/datadog_api_client/v2/models/create_table_request_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestData` object.
# The data object containing the table definition.
class CreateTableRequestData
include BaseGenericModel

# The definition of `CreateTableRequestDataAttributes` object.
# Attributes that define the reference table's configuration and properties.
attr_accessor :attributes

# The ID of the reference table.
attr_accessor :id

# Reference table resource type.
attr_reader :type

Expand All @@ -37,7 +34,6 @@ class CreateTableRequestData
def self.attribute_map
{
:'attributes' => :'attributes',
:'id' => :'id',
:'type' => :'type'
}
end
Expand All @@ -47,7 +43,6 @@ def self.attribute_map
def self.openapi_types
{
:'attributes' => :'CreateTableRequestDataAttributes',
:'id' => :'String',
:'type' => :'CreateTableRequestDataType'
}
end
Expand All @@ -74,10 +69,6 @@ def initialize(attributes = {})
self.attributes = attributes[:'attributes']
end

if attributes.key?(:'id')
self.id = attributes[:'id']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
end
Expand Down Expand Up @@ -128,7 +119,6 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
attributes == o.attributes &&
id == o.id &&
type == o.type &&
additional_properties == o.additional_properties
end
Expand All @@ -137,7 +127,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[attributes, id, type, additional_properties].hash
[attributes, type, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributes` object.
# Attributes that define the reference table's configuration and properties.
class CreateTableRequestDataAttributes
include BaseGenericModel

# The description of the reference table.
# Optional text describing the purpose or contents of this reference table.
attr_accessor :description

# The definition of `CreateTableRequestDataAttributesFileMetadata` object.
# Metadata specifying where and how to access the reference table's data file.
attr_accessor :file_metadata

# The definition of `CreateTableRequestDataAttributesSchema` object.
# Schema defining the structure and columns of the reference table.
attr_reader :schema

# The source type for creating reference table data. Only these source types can be created through this API.
attr_reader :source

# The name of the reference table.
# Name to identify this reference table.
attr_reader :table_name

# The tags of the reference table.
# Tags for organizing and filtering reference tables.
attr_accessor :tags

attr_accessor :additional_properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesFileMetadata` object.
# Metadata specifying where and how to access the reference table's data file.
module CreateTableRequestDataAttributesFileMetadata
class << self
include BaseOneOfModel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module DatadogAPIClient::V2
class CreateTableRequestDataAttributesFileMetadataCloudStorage
include BaseGenericModel

# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
# Cloud storage access configuration for the reference table data file.
attr_reader :access_details

# Whether this table is synced automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object.
# Cloud storage access configuration for the reference table data file.
class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails
include BaseGenericModel

# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object.
# Amazon Web Services S3 storage access configuration.
attr_accessor :aws_detail

# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object.
# Azure Blob Storage access configuration.
attr_accessor :azure_detail

# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object.
# Google Cloud Platform storage access configuration.
attr_accessor :gcp_detail

attr_accessor :additional_properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object.
# Amazon Web Services S3 storage access configuration.
class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail
include BaseGenericModel

# The ID of the AWS account.
# AWS account ID where the S3 bucket is located.
attr_reader :aws_account_id

# The name of the Amazon S3 bucket.
# S3 bucket containing the CSV file.
attr_reader :aws_bucket_name

# The relative file path from the S3 bucket root to the CSV file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object.
# Azure Blob Storage access configuration.
class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail
include BaseGenericModel

# The Azure client ID.
# Azure service principal (application) client ID with permissions to read from the container.
attr_reader :azure_client_id

# The name of the Azure container.
# Azure Blob Storage container containing the CSV file.
attr_reader :azure_container_name

# The name of the Azure storage account.
# Azure storage account where the container is located.
attr_reader :azure_storage_account_name

# The ID of the Azure tenant.
# Azure Active Directory tenant ID.
attr_reader :azure_tenant_id

# The relative file path from the Azure container root to the CSV file.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object.
# Google Cloud Platform storage access configuration.
class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail
include BaseGenericModel

# The relative file path from the GCS bucket root to the CSV file.
attr_reader :file_path

# The name of the GCP bucket.
# GCP bucket containing the CSV file.
attr_reader :gcp_bucket_name

# The ID of the GCP project.
# GCP project ID where the bucket is located.
attr_reader :gcp_project_id

# The email of the GCP service account.
# Service account email with read permissions for the GCS bucket.
attr_reader :gcp_service_account_email

attr_accessor :additional_properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesSchema` object.
# Schema defining the structure and columns of the reference table.
class CreateTableRequestDataAttributesSchema
include BaseGenericModel

# The `schema` `fields`.
# The schema fields.
attr_reader :fields

# List of field names that serve as primary keys for the table. Only one primary key is supported, and it is used as an ID to retrieve rows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateTableRequestDataAttributesSchemaFieldsItems` object.
# A single field (column) in the reference table schema to be created.
class CreateTableRequestDataAttributesSchemaFieldsItems
include BaseGenericModel

Expand Down
4 changes: 2 additions & 2 deletions lib/datadog_api_client/v2/models/create_upload_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateUploadRequest` object.
# Request to create an upload for a file to be ingested into a reference table.
class CreateUploadRequest
include BaseGenericModel

# The definition of `CreateUploadRequestData` object.
# Request data for creating an upload for a file to be ingested into a reference table.
attr_accessor :data

attr_accessor :additional_properties
Expand Down
16 changes: 3 additions & 13 deletions lib/datadog_api_client/v2/models/create_upload_request_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,13 @@
require 'time'

module DatadogAPIClient::V2
# The definition of `CreateUploadRequestData` object.
# Request data for creating an upload for a file to be ingested into a reference table.
class CreateUploadRequestData
include BaseGenericModel

# The definition of `CreateUploadRequestDataAttributes` object.
# Upload configuration specifying how data will be uploaded by the user, and properties of the table to associate the upload with.
attr_accessor :attributes

# The ID of the upload.
attr_accessor :id

# Upload resource type.
attr_reader :type

Expand All @@ -37,7 +34,6 @@ class CreateUploadRequestData
def self.attribute_map
{
:'attributes' => :'attributes',
:'id' => :'id',
:'type' => :'type'
}
end
Expand All @@ -47,7 +43,6 @@ def self.attribute_map
def self.openapi_types
{
:'attributes' => :'CreateUploadRequestDataAttributes',
:'id' => :'String',
:'type' => :'CreateUploadRequestDataType'
}
end
Expand All @@ -74,10 +69,6 @@ def initialize(attributes = {})
self.attributes = attributes[:'attributes']
end

if attributes.key?(:'id')
self.id = attributes[:'id']
end

if attributes.key?(:'type')
self.type = attributes[:'type']
end
Expand Down Expand Up @@ -128,7 +119,6 @@ def ==(o)
return true if self.equal?(o)
self.class == o.class &&
attributes == o.attributes &&
id == o.id &&
type == o.type &&
additional_properties == o.additional_properties
end
Expand All @@ -137,7 +127,7 @@ def ==(o)
# @return [Integer] Hash code
# @!visibility private
def hash
[attributes, id, type, additional_properties].hash
[attributes, type, additional_properties].hash
end
end
end
Loading
Loading