diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index ea3da24e20..c5c1761de8 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' @@ -51089,32 +51076,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 +51131,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. @@ -73470,6 +73445,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/docs/datadog_api_client.v2.model.rst b/docs/datadog_api_client.v2.model.rst index d3b3e6cfe5..d0524a57c6 100644 --- a/docs/datadog_api_client.v2.model.rst +++ b/docs/datadog_api_client.v2.model.rst @@ -22537,13 +22537,6 @@ datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadat :members: :show-inheritance: -datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadata\_cloud\_storage module --------------------------------------------------------------------------------------------------------- - -.. automodule:: datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage - :members: - :show-inheritance: - datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadata\_cloud\_storage\_error\_type module --------------------------------------------------------------------------------------------------------------------- @@ -22551,13 +22544,6 @@ datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadat :members: :show-inheritance: -datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadata\_local\_file module ------------------------------------------------------------------------------------------------------ - -.. automodule:: datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_local_file - :members: - :show-inheritance: - datadog\_api\_client.v2.model.table\_result\_v2\_data\_attributes\_file\_metadata\_one\_of\_access\_details module ------------------------------------------------------------------------------------------------------------------ diff --git a/examples/v2/reference-tables/CreateReferenceTable.py b/examples/v2/reference-tables/CreateReferenceTable.py index 9429566c24..ebab4acde4 100644 --- a/examples/v2/reference-tables/CreateReferenceTable.py +++ b/examples/v2/reference-tables/CreateReferenceTable.py @@ -16,6 +16,12 @@ from datadog_api_client.v2.model.create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail import ( CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail, ) +from datadog_api_client.v2.model.create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail import ( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail, +) +from datadog_api_client.v2.model.create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail import ( + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail, +) from datadog_api_client.v2.model.create_table_request_data_attributes_schema import ( CreateTableRequestDataAttributesSchema, ) @@ -29,36 +35,45 @@ body = CreateTableRequest( data=CreateTableRequestData( attributes=CreateTableRequestDataAttributes( - description="this is a cloud table generated via a cloud bucket sync", file_metadata=CreateTableRequestDataAttributesFileMetadataCloudStorage( access_details=CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails( aws_detail=CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail( - 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=CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail( + 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=CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail( + 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=CreateTableRequestDataAttributesSchema( fields=[ CreateTableRequestDataAttributesSchemaFieldsItems( - name="name", - type=ReferenceTableSchemaFieldType.STRING, - ), - CreateTableRequestDataAttributesSchemaFieldsItems( - name="account_id", + name="field_1", type=ReferenceTableSchemaFieldType.STRING, ), ], primary_keys=[ - "account_id", + "field_1", ], ), - source=ReferenceTableCreateSourceType.S3, - table_name="test_reference_table", + source=ReferenceTableCreateSourceType.LOCAL_FILE, + table_name="table_1", tags=[ - "test_tag", + "tag_1", + "tag_2", ], ), type=CreateTableRequestDataType.REFERENCE_TABLE, diff --git a/src/datadog_api_client/v2/model/table_result_v2_data_attributes.py b/src/datadog_api_client/v2/model/table_result_v2_data_attributes.py index b7307c0081..123f88cfeb 100644 --- a/src/datadog_api_client/v2/model/table_result_v2_data_attributes.py +++ b/src/datadog_api_client/v2/model/table_result_v2_data_attributes.py @@ -19,12 +19,6 @@ ) from datadog_api_client.v2.model.table_result_v2_data_attributes_schema import TableResultV2DataAttributesSchema from datadog_api_client.v2.model.reference_table_source_type import ReferenceTableSourceType - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage import ( - TableResultV2DataAttributesFileMetadataCloudStorage, - ) - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_local_file import ( - TableResultV2DataAttributesFileMetadataLocalFile, - ) class TableResultV2DataAttributes(ModelNormal): @@ -68,12 +62,7 @@ def __init__( self_, created_by: Union[str, UnsetType] = unset, description: Union[str, UnsetType] = unset, - file_metadata: Union[ - TableResultV2DataAttributesFileMetadata, - TableResultV2DataAttributesFileMetadataCloudStorage, - TableResultV2DataAttributesFileMetadataLocalFile, - UnsetType, - ] = unset, + file_metadata: Union[TableResultV2DataAttributesFileMetadata, UnsetType] = unset, last_updated_by: Union[str, UnsetType] = unset, row_count: Union[int, UnsetType] = unset, schema: Union[TableResultV2DataAttributesSchema, UnsetType] = unset, @@ -94,6 +83,16 @@ def __init__( :type description: str, optional :param file_metadata: 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 :type file_metadata: TableResultV2DataAttributesFileMetadata, optional :param last_updated_by: UUID of the user who last updated the reference table. diff --git a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata.py b/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata.py index 8e4326f49e..ef32ae0482 100644 --- a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata.py +++ b/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata.py @@ -3,54 +3,100 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import Union, TYPE_CHECKING from datadog_api_client.model_utils import ( - ModelComposed, + ModelNormal, cached_property, + unset, + UnsetType, ) -class TableResultV2DataAttributesFileMetadata(ModelComposed): - def __init__(self, **kwargs): +if TYPE_CHECKING: + from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_one_of_access_details import ( + TableResultV2DataAttributesFileMetadataOneOfAccessDetails, + ) + from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type import ( + TableResultV2DataAttributesFileMetadataCloudStorageErrorType, + ) + + +class TableResultV2DataAttributesFileMetadata(ModelNormal): + @cached_property + def additional_properties_type(_): + return None + + @cached_property + def openapi_types(_): + from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_one_of_access_details import ( + TableResultV2DataAttributesFileMetadataOneOfAccessDetails, + ) + from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type import ( + TableResultV2DataAttributesFileMetadataCloudStorageErrorType, + ) + + return { + "access_details": (TableResultV2DataAttributesFileMetadataOneOfAccessDetails,), + "error_message": (str,), + "error_row_count": (int,), + "error_type": (TableResultV2DataAttributesFileMetadataCloudStorageErrorType,), + "sync_enabled": (bool,), + } + + attribute_map = { + "access_details": "access_details", + "error_message": "error_message", + "error_row_count": "error_row_count", + "error_type": "error_type", + "sync_enabled": "sync_enabled", + } + + def __init__( + self_, + access_details: Union[TableResultV2DataAttributesFileMetadataOneOfAccessDetails, UnsetType] = unset, + error_message: Union[str, UnsetType] = unset, + error_row_count: Union[int, UnsetType] = unset, + error_type: Union[TableResultV2DataAttributesFileMetadataCloudStorageErrorType, UnsetType] = unset, + sync_enabled: Union[bool, UnsetType] = unset, + **kwargs, + ): """ 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 + :param access_details: Cloud storage access configuration for the reference table data file. - :type access_details: TableResultV2DataAttributesFileMetadataOneOfAccessDetails + :type access_details: TableResultV2DataAttributesFileMetadataOneOfAccessDetails, optional - :param error_message: The error message returned from the sync. + :param error_message: The error message returned from the last operation (sync for cloud storage, upload for local file). :type error_message: str, optional - :param error_row_count: The number of rows that failed to sync. + :param error_row_count: The number of rows that failed to process. :type error_row_count: int, optional :param error_type: 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. :type error_type: TableResultV2DataAttributesFileMetadataCloudStorageErrorType, optional - :param sync_enabled: Whether this table is synced automatically. + :param sync_enabled: Whether this table is synced automatically from cloud storage. Only applicable for cloud storage sources. :type sync_enabled: bool, optional """ + if access_details is not unset: + kwargs["access_details"] = access_details + if error_message is not unset: + kwargs["error_message"] = error_message + if error_row_count is not unset: + kwargs["error_row_count"] = error_row_count + if error_type is not unset: + kwargs["error_type"] = error_type + if sync_enabled is not unset: + kwargs["sync_enabled"] = sync_enabled super().__init__(kwargs) - - @cached_property - def _composed_schemas(_): - # we need this here to make our import statements work - # we must store _composed_schemas in here so the code is only run - # when we invoke this method. If we kept this at the class - # level we would get an error because the class level - # code would be run when this module is imported, and these composed - # classes don't exist yet because their module has not finished - # loading - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage import ( - TableResultV2DataAttributesFileMetadataCloudStorage, - ) - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_local_file import ( - TableResultV2DataAttributesFileMetadataLocalFile, - ) - - return { - "oneOf": [ - TableResultV2DataAttributesFileMetadataCloudStorage, - TableResultV2DataAttributesFileMetadataLocalFile, - ], - } diff --git a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_cloud_storage.py b/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_cloud_storage.py deleted file mode 100644 index 4d983be000..0000000000 --- a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_cloud_storage.py +++ /dev/null @@ -1,92 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union, TYPE_CHECKING - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -if TYPE_CHECKING: - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_one_of_access_details import ( - TableResultV2DataAttributesFileMetadataOneOfAccessDetails, - ) - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type import ( - TableResultV2DataAttributesFileMetadataCloudStorageErrorType, - ) - - -class TableResultV2DataAttributesFileMetadataCloudStorage(ModelNormal): - @cached_property - def additional_properties_type(_): - return None - - @cached_property - def openapi_types(_): - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_one_of_access_details import ( - TableResultV2DataAttributesFileMetadataOneOfAccessDetails, - ) - from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type import ( - TableResultV2DataAttributesFileMetadataCloudStorageErrorType, - ) - - return { - "access_details": (TableResultV2DataAttributesFileMetadataOneOfAccessDetails,), - "error_message": (str,), - "error_row_count": (int,), - "error_type": (TableResultV2DataAttributesFileMetadataCloudStorageErrorType,), - "sync_enabled": (bool,), - } - - attribute_map = { - "access_details": "access_details", - "error_message": "error_message", - "error_row_count": "error_row_count", - "error_type": "error_type", - "sync_enabled": "sync_enabled", - } - - def __init__( - self_, - access_details: TableResultV2DataAttributesFileMetadataOneOfAccessDetails, - error_message: Union[str, UnsetType] = unset, - error_row_count: Union[int, UnsetType] = unset, - error_type: Union[TableResultV2DataAttributesFileMetadataCloudStorageErrorType, UnsetType] = unset, - sync_enabled: Union[bool, UnsetType] = unset, - **kwargs, - ): - """ - File metadata for reference tables created by cloud storage. - - :param access_details: Cloud storage access configuration for the reference table data file. - :type access_details: TableResultV2DataAttributesFileMetadataOneOfAccessDetails - - :param error_message: The error message returned from the sync. - :type error_message: str, optional - - :param error_row_count: The number of rows that failed to sync. - :type error_row_count: int, optional - - :param error_type: 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. - :type error_type: TableResultV2DataAttributesFileMetadataCloudStorageErrorType, optional - - :param sync_enabled: Whether this table is synced automatically. - :type sync_enabled: bool, optional - """ - if error_message is not unset: - kwargs["error_message"] = error_message - if error_row_count is not unset: - kwargs["error_row_count"] = error_row_count - if error_type is not unset: - kwargs["error_type"] = error_type - if sync_enabled is not unset: - kwargs["sync_enabled"] = sync_enabled - super().__init__(kwargs) - - self_.access_details = access_details diff --git a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_local_file.py b/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_local_file.py deleted file mode 100644 index 7d65a0ab80..0000000000 --- a/src/datadog_api_client/v2/model/table_result_v2_data_attributes_file_metadata_local_file.py +++ /dev/null @@ -1,49 +0,0 @@ -# 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 2019-Present Datadog, Inc. -from __future__ import annotations - -from typing import Union - -from datadog_api_client.model_utils import ( - ModelNormal, - cached_property, - unset, - UnsetType, -) - - -class TableResultV2DataAttributesFileMetadataLocalFile(ModelNormal): - @cached_property - def additional_properties_type(_): - return None - - @cached_property - def openapi_types(_): - return { - "error_message": (str,), - "error_row_count": (int,), - } - - attribute_map = { - "error_message": "error_message", - "error_row_count": "error_row_count", - } - - def __init__( - self_, error_message: Union[str, UnsetType] = unset, error_row_count: Union[int, UnsetType] = unset, **kwargs - ): - """ - 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. - - :param error_message: The error message returned from the creation/update. - :type error_message: str, optional - - :param error_row_count: The number of rows that failed to create/update. - :type error_row_count: int, optional - """ - if error_message is not unset: - kwargs["error_message"] = error_message - if error_row_count is not unset: - kwargs["error_row_count"] = error_row_count - super().__init__(kwargs) diff --git a/src/datadog_api_client/v2/models/__init__.py b/src/datadog_api_client/v2/models/__init__.py index 5ff8672784..e9cd484dc0 100644 --- a/src/datadog_api_client/v2/models/__init__.py +++ b/src/datadog_api_client/v2/models/__init__.py @@ -4506,15 +4506,9 @@ from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata import ( TableResultV2DataAttributesFileMetadata, ) -from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage import ( - TableResultV2DataAttributesFileMetadataCloudStorage, -) from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_cloud_storage_error_type import ( TableResultV2DataAttributesFileMetadataCloudStorageErrorType, ) -from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_local_file import ( - TableResultV2DataAttributesFileMetadataLocalFile, -) from datadog_api_client.v2.model.table_result_v2_data_attributes_file_metadata_one_of_access_details import ( TableResultV2DataAttributesFileMetadataOneOfAccessDetails, ) @@ -8128,9 +8122,7 @@ "TableResultV2Data", "TableResultV2DataAttributes", "TableResultV2DataAttributesFileMetadata", - "TableResultV2DataAttributesFileMetadataCloudStorage", "TableResultV2DataAttributesFileMetadataCloudStorageErrorType", - "TableResultV2DataAttributesFileMetadataLocalFile", "TableResultV2DataAttributesFileMetadataOneOfAccessDetails", "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail", "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail", diff --git a/tests/v2/features/reference_tables.feature b/tests/v2/features/reference_tables.feature index 6d4bc4b97f..fa3ea42360 100644 --- a/tests/v2/features/reference_tables.feature +++ b/tests/v2/features/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