diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 2b877f268dc..71b4528bc8d 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13142,30 +13142,6 @@ components: CreateTableRequest: description: Request body for creating a new reference table from a local file or cloud storage. - example: - 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: name - type: STRING - - name: account_id - type: STRING - primary_keys: - - account_id - source: S3 - table_name: test_reference_table - tags: - - test_tag - type: reference_table properties: data: $ref: '#/components/schemas/CreateTableRequestData' @@ -13387,6 +13363,17 @@ components: CreateUploadRequest: description: Request to create an upload for a file to be ingested into a reference table. + example: + data: + attributes: + headers: + - product_id + - product_name + - price + part_count: 3 + part_size: 10000000 + table_name: my_products_table + type: upload properties: data: $ref: '#/components/schemas/CreateUploadRequestData' @@ -28217,6 +28204,10 @@ components: description: The date/time when the rotation starts (ISO 8601). format: date-time type: string + time_zone: + description: The time zone for this layer. + example: America/New_York + type: string type: object LayerAttributesInterval: description: Defines how often the rotation repeats, using a combination of @@ -44321,6 +44312,10 @@ components: example: '2025-01-01T00:00:00Z' format: date-time type: string + time_zone: + description: The time zone for this layer. + example: America/New_York + type: string required: - name - interval @@ -44671,6 +44666,10 @@ components: example: '2025-02-01T00:00:00Z' format: date-time type: string + time_zone: + description: The time zone for this layer. + example: America/New_York + type: string required: - effective_date - interval @@ -51089,32 +51088,35 @@ components: type: string type: object TableResultV2DataAttributesFileMetadata: - description: Metadata specifying where and how to access the reference table's - data file. - oneOf: - - $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorage' - - $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataLocalFile' - TableResultV2DataAttributesFileMetadataCloudStorage: additionalProperties: false - description: File metadata for reference tables created by cloud storage. + description: "Metadata specifying where and how to access the reference table's + data file.\n\nFor cloud storage tables (S3/GCS/Azure):\n - sync_enabled and + access_details will always be present\n - error fields (error_message, error_row_count, + error_type) are present only when errors occur\n\nFor local file tables:\n + \ - error fields (error_message, error_row_count) are present only when errors + occur\n - sync_enabled, access_details are never present" properties: access_details: $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetails' + description: Cloud storage access configuration. Only present for cloud + storage sources (S3, GCS, Azure). error_message: - description: The error message returned from the sync. + description: The error message returned from the last operation (sync for + cloud storage, upload for local file). type: string error_row_count: - description: The number of rows that failed to sync. + description: The number of rows that failed to process. format: int64 type: integer error_type: $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorageErrorType' + description: The type of error that occurred during file processing. Only + applicable for cloud storage sources. sync_enabled: - description: Whether this table is synced automatically. + description: Whether this table is synced automatically from cloud storage. + Only applicable for cloud storage sources. type: boolean - required: - - access_details - title: CloudFileMetadataV2 + title: FileMetadataV2 type: object TableResultV2DataAttributesFileMetadataCloudStorageErrorType: description: The type of error that occurred during file processing. This field @@ -51141,21 +51143,6 @@ components: - STATE_ERROR - OPERATION_ERROR - SYSTEM_ERROR - TableResultV2DataAttributesFileMetadataLocalFile: - additionalProperties: false - description: File metadata for reference tables created by upload. Note that - upload_id is only returned in the immediate create/replace response and is - not available in subsequent GET requests. - properties: - error_message: - description: The error message returned from the creation/update. - type: string - error_row_count: - description: The number of rows that failed to create/update. - format: int64 - type: integer - title: LocalFileMetadataV2 - type: object TableResultV2DataAttributesFileMetadataOneOfAccessDetails: description: Cloud storage access configuration for the reference table data file. @@ -73511,6 +73498,58 @@ paths: requestBody: content: application/json: + examples: + cloud_storage: + summary: Create table from cloud storage (S3) + value: + data: + attributes: + description: Customer reference data synced from S3 + file_metadata: + access_details: + aws_detail: + aws_account_id: '924305315327' + aws_bucket_name: my-data-bucket + file_path: customers.csv + sync_enabled: true + schema: + fields: + - name: customer_id + type: STRING + - name: customer_name + type: STRING + - name: email + type: STRING + primary_keys: + - customer_id + source: S3 + table_name: customer_reference_data + tags: + - team:data-platform + type: reference_table + local_file: + summary: Create table from local file upload + value: + data: + attributes: + description: Product catalog uploaded via local file + file_metadata: + upload_id: 00000000-0000-0000-0000-000000000000 + schema: + fields: + - name: product_id + type: STRING + - name: product_name + type: STRING + - name: price + type: DOUBLE + primary_keys: + - product_id + source: LOCAL_FILE + table_name: product_catalog + tags: + - team:ecommerce + type: reference_table schema: $ref: '#/components/schemas/CreateTableRequest' required: true diff --git a/examples/v2/reference-tables/CreateReferenceTable.rb b/examples/v2/reference-tables/CreateReferenceTable.rb index af69feb5f32..4ca8e9990cb 100644 --- a/examples/v2/reference-tables/CreateReferenceTable.rb +++ b/examples/v2/reference-tables/CreateReferenceTable.rb @@ -6,36 +6,45 @@ body = DatadogAPIClient::V2::CreateTableRequest.new({ data: DatadogAPIClient::V2::CreateTableRequestData.new({ attributes: DatadogAPIClient::V2::CreateTableRequestDataAttributes.new({ - description: "this is a cloud table generated via a cloud bucket sync", file_metadata: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataCloudStorage.new({ access_details: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails.new({ aws_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.new({ - aws_account_id: "test-account-id", - aws_bucket_name: "test-bucket", - file_path: "test_rt.csv", + aws_account_id: "123456789000", + aws_bucket_name: "example-data-bucket", + file_path: "reference-tables/users.csv", + }), + azure_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail.new({ + azure_client_id: "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", + azure_container_name: "reference-data", + azure_storage_account_name: "examplestorageaccount", + azure_tenant_id: "cccccccc-4444-5555-6666-dddddddddddd", + file_path: "tables/users.csv", + }), + gcp_detail: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail.new({ + file_path: "data/reference_tables/users.csv", + gcp_bucket_name: "example-data-bucket", + gcp_project_id: "example-gcp-project-12345", + gcp_service_account_email: "example-service@example-gcp-project-12345.iam.gserviceaccount.com", }), }), - sync_enabled: true, + sync_enabled: false, }), schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({ fields: [ DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ - name: "name", - type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, - }), - DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ - name: "account_id", + name: "field_1", type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, }), ], primary_keys: [ - "account_id", + "field_1", ], }), - source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::S3, - table_name: "test_reference_table", + source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::LOCAL_FILE, + table_name: "table_1", tags: [ - "test_tag", + "tag_1", + "tag_2", ], }), type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE, diff --git a/features/v2/reference_tables.feature b/features/v2/reference_tables.feature index 6d4bc4b97f5..fa3ea42360a 100644 --- a/features/v2/reference_tables.feature +++ b/features/v2/reference_tables.feature @@ -10,21 +10,21 @@ Feature: Reference Tables @generated @skip @team:DataDog/redapl-experiences Scenario: Create reference table returns "Bad Request" response Given new "CreateReferenceTable" request - 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": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}} + And body with value {"data": {"attributes": {"file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "123456789000", "aws_bucket_name": "example-data-bucket", "file_path": "reference-tables/users.csv"}, "azure_detail": {"azure_client_id": "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "azure_container_name": "reference-data", "azure_storage_account_name": "examplestorageaccount", "azure_tenant_id": "cccccccc-4444-5555-6666-dddddddddddd", "file_path": "tables/users.csv"}, "gcp_detail": {"file_path": "data/reference_tables/users.csv", "gcp_bucket_name": "example-data-bucket", "gcp_project_id": "example-gcp-project-12345", "gcp_service_account_email": "example-service@example-gcp-project-12345.iam.gserviceaccount.com"}}, "sync_enabled": false}, "schema": {"fields": [{"name": "field_1", "type": "STRING"}], "primary_keys": ["field_1"]}, "source": "LOCAL_FILE", "table_name": "table_1", "tags": ["tag_1", "tag_2"]}, "type": "reference_table"}} When the request is sent Then the response status is 400 Bad Request @generated @skip @team:DataDog/redapl-experiences Scenario: Create reference table returns "Created" response Given new "CreateReferenceTable" request - 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": "name", "type": "STRING"}, {"name": "account_id", "type": "STRING"}], "primary_keys": ["account_id"]}, "source": "S3", "table_name": "test_reference_table", "tags": ["test_tag"]}, "type": "reference_table"}} + And body with value {"data": {"attributes": {"file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "123456789000", "aws_bucket_name": "example-data-bucket", "file_path": "reference-tables/users.csv"}, "azure_detail": {"azure_client_id": "aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb", "azure_container_name": "reference-data", "azure_storage_account_name": "examplestorageaccount", "azure_tenant_id": "cccccccc-4444-5555-6666-dddddddddddd", "file_path": "tables/users.csv"}, "gcp_detail": {"file_path": "data/reference_tables/users.csv", "gcp_bucket_name": "example-data-bucket", "gcp_project_id": "example-gcp-project-12345", "gcp_service_account_email": "example-service@example-gcp-project-12345.iam.gserviceaccount.com"}}, "sync_enabled": false}, "schema": {"fields": [{"name": "field_1", "type": "STRING"}], "primary_keys": ["field_1"]}, "source": "LOCAL_FILE", "table_name": "table_1", "tags": ["tag_1", "tag_2"]}, "type": "reference_table"}} When the request is sent Then the response status is 201 Created @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": ["field_1", "field_2"], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}} + And body with value {"data": {"attributes": {"headers": ["product_id", "product_name", "price"], "part_count": 3, "part_size": 10000000, "table_name": "my_products_table"}, "type": "upload"}} When the request is sent Then the response status is 400 Bad Request diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 569cb7cb770..c9986005c52 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4158,9 +4158,7 @@ def overrides "v2.table_result_v2_data" => "TableResultV2Data", "v2.table_result_v2_data_attributes" => "TableResultV2DataAttributes", "v2.table_result_v2_data_attributes_file_metadata" => "TableResultV2DataAttributesFileMetadata", - "v2.table_result_v2_data_attributes_file_metadata_cloud_storage" => "TableResultV2DataAttributesFileMetadataCloudStorage", "v2.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type" => "TableResultV2DataAttributesFileMetadataCloudStorageErrorType", - "v2.table_result_v2_data_attributes_file_metadata_local_file" => "TableResultV2DataAttributesFileMetadataLocalFile", "v2.table_result_v2_data_attributes_file_metadata_one_of_access_details" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetails", "v2.table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail", "v2.table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail", diff --git a/lib/datadog_api_client/v2/models/layer_attributes.rb b/lib/datadog_api_client/v2/models/layer_attributes.rb index 739d19f658a..6a0e80e9286 100644 --- a/lib/datadog_api_client/v2/models/layer_attributes.rb +++ b/lib/datadog_api_client/v2/models/layer_attributes.rb @@ -39,6 +39,9 @@ class LayerAttributes # The date/time when the rotation starts (ISO 8601). attr_accessor :rotation_start + # The time zone for this layer. + attr_accessor :time_zone + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -50,7 +53,8 @@ def self.attribute_map :'interval' => :'interval', :'name' => :'name', :'restrictions' => :'restrictions', - :'rotation_start' => :'rotation_start' + :'rotation_start' => :'rotation_start', + :'time_zone' => :'time_zone' } end @@ -63,7 +67,8 @@ def self.openapi_types :'interval' => :'LayerAttributesInterval', :'name' => :'String', :'restrictions' => :'Array', - :'rotation_start' => :'Time' + :'rotation_start' => :'Time', + :'time_zone' => :'String' } end @@ -110,6 +115,10 @@ def initialize(attributes = {}) if attributes.key?(:'rotation_start') self.rotation_start = attributes[:'rotation_start'] end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end end # Returns the object in the form of hash, with additionalProperties support. @@ -144,6 +153,7 @@ def ==(o) name == o.name && restrictions == o.restrictions && rotation_start == o.rotation_start && + time_zone == o.time_zone && additional_properties == o.additional_properties end @@ -151,7 +161,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [effective_date, end_date, interval, name, restrictions, rotation_start, additional_properties].hash + [effective_date, end_date, interval, name, restrictions, rotation_start, time_zone, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb b/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb index 084b29a74a4..f13f117161f 100644 --- a/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb +++ b/lib/datadog_api_client/v2/models/schedule_create_request_data_attributes_layers_items.rb @@ -42,6 +42,9 @@ class ScheduleCreateRequestDataAttributesLayersItems # The date/time when the rotation for this layer starts (in ISO 8601). attr_reader :rotation_start + # The time zone for this layer. + attr_accessor :time_zone + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -54,7 +57,8 @@ def self.attribute_map :'members' => :'members', :'name' => :'name', :'restrictions' => :'restrictions', - :'rotation_start' => :'rotation_start' + :'rotation_start' => :'rotation_start', + :'time_zone' => :'time_zone' } end @@ -68,7 +72,8 @@ def self.openapi_types :'members' => :'Array', :'name' => :'String', :'restrictions' => :'Array', - :'rotation_start' => :'Time' + :'rotation_start' => :'Time', + :'time_zone' => :'String' } end @@ -121,6 +126,10 @@ def initialize(attributes = {}) if attributes.key?(:'rotation_start') self.rotation_start = attributes[:'rotation_start'] end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end end # Check to see if the all the properties in the model are valid @@ -218,6 +227,7 @@ def ==(o) name == o.name && restrictions == o.restrictions && rotation_start == o.rotation_start && + time_zone == o.time_zone && additional_properties == o.additional_properties end @@ -225,7 +235,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [effective_date, end_date, interval, members, name, restrictions, rotation_start, additional_properties].hash + [effective_date, end_date, interval, members, name, restrictions, rotation_start, time_zone, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb b/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb index 77db73da022..d66f7880ec4 100644 --- a/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb +++ b/lib/datadog_api_client/v2/models/schedule_update_request_data_attributes_layers_items.rb @@ -46,6 +46,9 @@ class ScheduleUpdateRequestDataAttributesLayersItems # The date/time at which the rotation begins (ISO 8601 format). attr_reader :rotation_start + # The time zone for this layer. + attr_accessor :time_zone + attr_accessor :additional_properties # Attribute mapping from ruby-style variable name to JSON key. @@ -59,7 +62,8 @@ def self.attribute_map :'members' => :'members', :'name' => :'name', :'restrictions' => :'restrictions', - :'rotation_start' => :'rotation_start' + :'rotation_start' => :'rotation_start', + :'time_zone' => :'time_zone' } end @@ -74,7 +78,8 @@ def self.openapi_types :'members' => :'Array', :'name' => :'String', :'restrictions' => :'Array', - :'rotation_start' => :'Time' + :'rotation_start' => :'Time', + :'time_zone' => :'String' } end @@ -131,6 +136,10 @@ def initialize(attributes = {}) if attributes.key?(:'rotation_start') self.rotation_start = attributes[:'rotation_start'] end + + if attributes.key?(:'time_zone') + self.time_zone = attributes[:'time_zone'] + end end # Check to see if the all the properties in the model are valid @@ -229,6 +238,7 @@ def ==(o) name == o.name && restrictions == o.restrictions && rotation_start == o.rotation_start && + time_zone == o.time_zone && additional_properties == o.additional_properties end @@ -236,7 +246,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [effective_date, end_date, id, interval, members, name, restrictions, rotation_start, additional_properties].hash + [effective_date, end_date, id, interval, members, name, restrictions, rotation_start, time_zone, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb index fbe8e3dd87b..5febe2620ea 100644 --- a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb @@ -28,6 +28,14 @@ class TableResultV2DataAttributes attr_accessor :description # Metadata specifying where and how to access the reference table's data file. + # + # For cloud storage tables (S3/GCS/Azure): + # - sync_enabled and access_details will always be present + # - error fields (error_message, error_row_count, error_type) are present only when errors occur + # + # For local file tables: + # - error fields (error_message, error_row_count) are present only when errors occur + # - sync_enabled, access_details are never present attr_accessor :file_metadata # UUID of the user who last updated the reference table. diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb index 116e19841bd..a55135c931f 100644 --- a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb @@ -18,46 +18,111 @@ module DatadogAPIClient::V2 # Metadata specifying where and how to access the reference table's data file. - module TableResultV2DataAttributesFileMetadata - class << self - include BaseOneOfModel - include BaseOneOfModelNoDiscriminator - - # List of class defined in oneOf (OpenAPI v3) - def openapi_one_of - [ - :'TableResultV2DataAttributesFileMetadataCloudStorage', - :'TableResultV2DataAttributesFileMetadataLocalFile' - ] + # + # For cloud storage tables (S3/GCS/Azure): + # - sync_enabled and access_details will always be present + # - error fields (error_message, error_row_count, error_type) are present only when errors occur + # + # For local file tables: + # - error fields (error_message, error_row_count) are present only when errors occur + # - sync_enabled, access_details are never present + class TableResultV2DataAttributesFileMetadata + include BaseGenericModel + + # Cloud storage access configuration for the reference table data file. + attr_accessor :access_details + + # The error message returned from the last operation (sync for cloud storage, upload for local file). + attr_accessor :error_message + + # The number of rows that failed to process. + attr_accessor :error_row_count + + # The type of error that occurred during file processing. This field provides high-level error categories for easier troubleshooting and is only present when there are errors. + attr_accessor :error_type + + # Whether this table is synced automatically from cloud storage. Only applicable for cloud storage sources. + attr_accessor :sync_enabled + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_details' => :'access_details', + :'error_message' => :'error_message', + :'error_row_count' => :'error_row_count', + :'error_type' => :'error_type', + :'sync_enabled' => :'sync_enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_details' => :'TableResultV2DataAttributesFileMetadataOneOfAccessDetails', + :'error_message' => :'String', + :'error_row_count' => :'Integer', + :'error_type' => :'TableResultV2DataAttributesFileMetadataCloudStorageErrorType', + :'sync_enabled' => :'Boolean' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadata` initialize method" end - # Builds the object - # @param data [Mixed] Data to be matched against the list of oneOf items - # @return [Object] Returns the model or the data itself - def build(data) - # Go through the list of oneOf items and attempt to identify the appropriate one. - # Note: - # - We do not attempt to check whether exactly one item matches. - # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) - # due to the way the deserialization is made in the base_object template (it just casts without verifying). - # - TODO: scalar values are de facto behaving as if they were nullable. - # - TODO: logging when debugging is set. - openapi_one_of.each do |klass| - begin - next if klass == :AnyType # "nullable: true" - typed_data = find_and_cast_into_type(klass, data) - next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed - return typed_data if typed_data - rescue # rescue all errors so we keep iterating even if the current item lookup raises - end - end - if openapi_one_of.include?(:AnyType) - data - else - self._unparsed = true - DatadogAPIClient::UnparsedObject.new(data) + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end + h[k.to_sym] = v + } + + if attributes.key?(:'access_details') + self.access_details = attributes[:'access_details'] end + + if attributes.key?(:'error_message') + self.error_message = attributes[:'error_message'] + end + + if attributes.key?(:'error_row_count') + self.error_row_count = attributes[:'error_row_count'] + end + + if attributes.key?(:'error_type') + self.error_type = attributes[:'error_type'] + end + + if attributes.key?(:'sync_enabled') + self.sync_enabled = attributes[:'sync_enabled'] + end + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + access_details == o.access_details && + error_message == o.error_message && + error_row_count == o.error_row_count && + error_type == o.error_type && + sync_enabled == o.sync_enabled + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_details, error_message, error_row_count, error_type, sync_enabled].hash end end end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb deleted file mode 100644 index e3e3be612fd..00000000000 --- a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb +++ /dev/null @@ -1,138 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # File metadata for reference tables created by cloud storage. - class TableResultV2DataAttributesFileMetadataCloudStorage - include BaseGenericModel - - # Cloud storage access configuration for the reference table data file. - attr_reader :access_details - - # The error message returned from the sync. - attr_accessor :error_message - - # The number of rows that failed to sync. - attr_accessor :error_row_count - - # The type of error that occurred during file processing. This field provides high-level error categories for easier troubleshooting and is only present when there are errors. - attr_accessor :error_type - - # Whether this table is synced automatically. - attr_accessor :sync_enabled - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'access_details' => :'access_details', - :'error_message' => :'error_message', - :'error_row_count' => :'error_row_count', - :'error_type' => :'error_type', - :'sync_enabled' => :'sync_enabled' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'access_details' => :'TableResultV2DataAttributesFileMetadataOneOfAccessDetails', - :'error_message' => :'String', - :'error_row_count' => :'Integer', - :'error_type' => :'TableResultV2DataAttributesFileMetadataCloudStorageErrorType', - :'sync_enabled' => :'Boolean' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadataCloudStorage` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadataCloudStorage`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'access_details') - self.access_details = attributes[:'access_details'] - end - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'error_row_count') - self.error_row_count = attributes[:'error_row_count'] - end - - if attributes.key?(:'error_type') - self.error_type = attributes[:'error_type'] - end - - if attributes.key?(:'sync_enabled') - self.sync_enabled = attributes[:'sync_enabled'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @access_details.nil? - true - end - - # Custom attribute writer method with validation - # @param access_details [Object] Object to be assigned - # @!visibility private - def access_details=(access_details) - if access_details.nil? - fail ArgumentError, 'invalid value for "access_details", access_details cannot be nil.' - end - @access_details = access_details - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - access_details == o.access_details && - error_message == o.error_message && - error_row_count == o.error_row_count && - error_type == o.error_type && - sync_enabled == o.sync_enabled - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [access_details, error_message, error_row_count, error_type, sync_enabled].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_local_file.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_local_file.rb deleted file mode 100644 index df6fa923ce0..00000000000 --- a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_local_file.rb +++ /dev/null @@ -1,90 +0,0 @@ -=begin -#Datadog API V2 Collection - -#Collection of all Datadog Public endpoints. - -The version of the OpenAPI document: 1.0 -Contact: support@datadoghq.com -Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator - - Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - This product includes software developed at Datadog (https://www.datadoghq.com/). - Copyright 2020-Present Datadog, Inc. - -=end - -require 'date' -require 'time' - -module DatadogAPIClient::V2 - # File metadata for reference tables created by upload. Note that upload_id is only returned in the immediate create/replace response and is not available in subsequent GET requests. - class TableResultV2DataAttributesFileMetadataLocalFile - include BaseGenericModel - - # The error message returned from the creation/update. - attr_accessor :error_message - - # The number of rows that failed to create/update. - attr_accessor :error_row_count - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'error_message' => :'error_message', - :'error_row_count' => :'error_row_count' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'error_message' => :'String', - :'error_row_count' => :'Integer' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadataLocalFile` initialize method" - end - - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::TableResultV2DataAttributesFileMetadataLocalFile`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } - - if attributes.key?(:'error_message') - self.error_message = attributes[:'error_message'] - end - - if attributes.key?(:'error_row_count') - self.error_row_count = attributes[:'error_row_count'] - end - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - error_message == o.error_message && - error_row_count == o.error_row_count - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [error_message, error_row_count].hash - end - end -end