From 6183223ed3a89baf7b540414ba09a859659e78bd Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 9 Oct 2025 18:04:35 +0000 Subject: [PATCH] Regenerate client from commit 46794aa of spec repo --- .generator/schemas/v2/openapi.yaml | 1297 +++++++++++++++++ ...etails-returns-Bad-Request-response.frozen | 1 + ...s-details-returns-Bad-Request-response.yml | 26 + .../reference-tables/CreateReferenceTable.rb | 44 + .../CreateReferenceTableUpload.rb | 21 + .../CreateReferenceTable_3196130987.rb | 41 + examples/v2/reference-tables/DeleteTable.rb | 5 + examples/v2/reference-tables/GetRowsByID.rb | 5 + examples/v2/reference-tables/GetTable.rb | 5 + examples/v2/reference-tables/ListTables.rb | 5 + .../reference-tables/UpdateReferenceTable.rb | 44 + features/scenarios_model_mapping.rb | 28 + features/v2/reference_tables.feature | 121 ++ features/v2/undo.json | 49 + lib/datadog_api_client/inflector.rb | 58 + .../v2/api/reference_tables_api.rb | 519 +++++++ .../v2/models/create_table_request.rb | 105 ++ .../v2/models/create_table_request_data.rb | 143 ++ .../create_table_request_data_attributes.rb | 197 +++ ...e_request_data_attributes_file_metadata.rb | 63 + ..._attributes_file_metadata_cloud_storage.rb | 119 ++ ...ata_attributes_file_metadata_local_file.rb | 98 ++ ...tes_file_metadata_one_of_access_details.rb | 125 ++ ...tadata_one_of_access_details_aws_detail.rb | 165 +++ ...data_one_of_access_details_azure_detail.rb | 207 +++ ...tadata_one_of_access_details_gcp_detail.rb | 186 +++ ...te_table_request_data_attributes_schema.rb | 148 ++ ...est_data_attributes_schema_fields_items.rb | 144 ++ .../models/create_table_request_data_type.rb | 26 + .../v2/models/create_upload_request.rb | 105 ++ .../v2/models/create_upload_request_data.rb | 143 ++ .../create_upload_request_data_attributes.rb | 192 +++ .../models/create_upload_request_data_type.rb | 26 + .../v2/models/create_upload_response.rb | 105 ++ .../v2/models/create_upload_response_data.rb | 143 ++ .../create_upload_response_data_attributes.rb | 107 ++ .../create_upload_response_data_type.rb | 26 + .../v2/models/patch_table_request.rb | 105 ++ .../v2/models/patch_table_request_data.rb | 143 ++ .../patch_table_request_data_attributes.rb | 147 ++ ...e_request_data_attributes_file_metadata.rb | 63 + ..._attributes_file_metadata_cloud_storage.rb | 90 ++ ...ata_attributes_file_metadata_local_file.rb | 98 ++ ...tes_file_metadata_one_of_access_details.rb | 125 ++ ...tadata_one_of_access_details_aws_detail.rb | 125 ++ ...data_one_of_access_details_azure_detail.rb | 145 ++ ...tadata_one_of_access_details_gcp_detail.rb | 135 ++ ...ch_table_request_data_attributes_schema.rb | 148 ++ ...est_data_attributes_schema_fields_items.rb | 144 ++ .../models/patch_table_request_data_type.rb | 26 + .../reference_table_create_source_type.rb | 29 + .../reference_table_schema_field_type.rb | 27 + .../v2/models/reference_table_sort_type.rb | 31 + .../v2/models/reference_table_source_type.rb | 33 + .../v2/models/table_result_v2.rb | 105 ++ .../v2/models/table_result_v2_array.rb | 125 ++ .../v2/models/table_result_v2_data.rb | 143 ++ .../models/table_result_v2_data_attributes.rb | 207 +++ ...result_v2_data_attributes_file_metadata.rb | 63 + ..._attributes_file_metadata_cloud_storage.rb | 145 ++ ..._file_metadata_cloud_storage_error_type.rb | 34 + ...ata_attributes_file_metadata_local_file.rb | 125 ++ ...tes_file_metadata_one_of_access_details.rb | 125 ++ ...tadata_one_of_access_details_aws_detail.rb | 125 ++ ...data_one_of_access_details_azure_detail.rb | 145 ++ ...tadata_one_of_access_details_gcp_detail.rb | 135 ++ .../table_result_v2_data_attributes_schema.rb | 148 ++ ..._v2_data_attributes_schema_fields_items.rb | 144 ++ .../v2/models/table_result_v2_data_type.rb | 26 + .../v2/models/table_row_resource_array.rb | 125 ++ .../v2/models/table_row_resource_data.rb | 143 ++ .../table_row_resource_data_attributes.rb | 105 ++ .../v2/models/table_row_resource_data_type.rb | 26 + 73 files changed, 8650 insertions(+) create mode 100644 cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.frozen create mode 100644 cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.yml create mode 100644 examples/v2/reference-tables/CreateReferenceTable.rb create mode 100644 examples/v2/reference-tables/CreateReferenceTableUpload.rb create mode 100644 examples/v2/reference-tables/CreateReferenceTable_3196130987.rb create mode 100644 examples/v2/reference-tables/DeleteTable.rb create mode 100644 examples/v2/reference-tables/GetRowsByID.rb create mode 100644 examples/v2/reference-tables/GetTable.rb create mode 100644 examples/v2/reference-tables/ListTables.rb create mode 100644 examples/v2/reference-tables/UpdateReferenceTable.rb create mode 100644 features/v2/reference_tables.feature create mode 100644 lib/datadog_api_client/v2/api/reference_tables_api.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_cloud_storage.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_local_file.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema_fields_items.rb create mode 100644 lib/datadog_api_client/v2/models/create_table_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_request.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_response.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/create_upload_response_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_cloud_storage.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_local_file.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema_fields_items.rb create mode 100644 lib/datadog_api_client/v2/models/patch_table_request_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/reference_table_create_source_type.rb create mode 100644 lib/datadog_api_client/v2/models/reference_table_schema_field_type.rb create mode 100644 lib/datadog_api_client/v2/models/reference_table_sort_type.rb create mode 100644 lib/datadog_api_client/v2/models/reference_table_source_type.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_array.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage_error_type.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_local_file.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema_fields_items.rb create mode 100644 lib/datadog_api_client/v2/models/table_result_v2_data_type.rb create mode 100644 lib/datadog_api_client/v2/models/table_row_resource_array.rb create mode 100644 lib/datadog_api_client/v2/models/table_row_resource_data.rb create mode 100644 lib/datadog_api_client/v2/models/table_row_resource_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/table_row_resource_data_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 79c3e338ffb..10a5a5875cd 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -12266,6 +12266,349 @@ components: type: string x-enum-varnames: - CREATE_RULESET + CreateTableRequest: + description: The definition of `CreateTableRequest` object. + 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' + type: object + CreateTableRequestData: + description: The definition of `CreateTableRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateTableRequestDataAttributes' + id: + description: The ID of the reference table. + type: string + type: + $ref: '#/components/schemas/CreateTableRequestDataType' + required: + - type + type: object + CreateTableRequestDataAttributes: + description: The definition of `CreateTableRequestDataAttributes` object. + properties: + description: + description: The description of the reference table. + type: string + file_metadata: + $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadata' + schema: + $ref: '#/components/schemas/CreateTableRequestDataAttributesSchema' + source: + $ref: '#/components/schemas/ReferenceTableCreateSourceType' + table_name: + description: The name of the reference table. + example: '' + type: string + tags: + description: The tags of the reference table. + items: + type: string + type: array + required: + - table_name + - schema + - source + type: object + CreateTableRequestDataAttributesFileMetadata: + description: The definition of `CreateTableRequestDataAttributesFileMetadata` + object. + oneOf: + - $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataCloudStorage' + - $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataLocalFile' + CreateTableRequestDataAttributesFileMetadataCloudStorage: + additionalProperties: false + description: Cloud storage file metadata for create requests. Both access_details + and sync_enabled are required. + properties: + access_details: + $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails' + sync_enabled: + description: Whether this table is synced automatically. + example: false + type: boolean + required: + - access_details + - sync_enabled + title: CloudFileMetadataV2 + type: object + CreateTableRequestDataAttributesFileMetadataLocalFile: + additionalProperties: false + description: Local file metadata for create requests using the upload ID. + properties: + upload_id: + description: The upload ID. + example: '' + type: string + required: + - upload_id + title: LocalFileMetadataV2 + type: object + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails: + description: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` + object. + properties: + aws_detail: + $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail' + azure_detail: + $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail' + gcp_detail: + $ref: '#/components/schemas/CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + type: object + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail: + description: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` + object. + properties: + aws_account_id: + description: The ID of the AWS account. + example: '123456789000' + type: string + aws_bucket_name: + description: The name of the Amazon S3 bucket. + example: example-data-bucket + type: string + file_path: + description: The relative file path from the S3 bucket root to the CSV file. + example: reference-tables/users.csv + type: string + required: + - aws_account_id + - aws_bucket_name + - file_path + type: object + x-oneOf-parent: + - AwsDetail + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail: + description: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` + object. + properties: + azure_client_id: + description: The Azure client ID. + example: aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb + type: string + azure_container_name: + description: The name of the Azure container. + example: reference-data + type: string + azure_storage_account_name: + description: The name of the Azure storage account. + example: examplestorageaccount + type: string + azure_tenant_id: + description: The ID of the Azure tenant. + example: cccccccc-4444-5555-6666-dddddddddddd + type: string + file_path: + description: The relative file path from the Azure container root to the + CSV file. + example: tables/users.csv + type: string + required: + - azure_client_id + - azure_container_name + - azure_storage_account_name + - azure_tenant_id + - file_path + type: object + x-oneOf-parent: + - AzureDetail + CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail: + description: The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` + object. + properties: + file_path: + description: The relative file path from the GCS bucket root to the CSV + file. + example: data/reference_tables/users.csv + type: string + gcp_bucket_name: + description: The name of the GCP bucket. + example: example-data-bucket + type: string + gcp_project_id: + description: The ID of the GCP project. + example: example-gcp-project-12345 + type: string + gcp_service_account_email: + description: The email of the GCP service account. + example: example-service@example-gcp-project-12345.iam.gserviceaccount.com + type: string + required: + - file_path + - gcp_bucket_name + - gcp_project_id + - gcp_service_account_email + type: object + x-oneOf-parent: + - GcpDetail + CreateTableRequestDataAttributesSchema: + description: The definition of `CreateTableRequestDataAttributesSchema` object. + properties: + fields: + description: The `schema` `fields`. + items: + $ref: '#/components/schemas/CreateTableRequestDataAttributesSchemaFieldsItems' + type: array + primary_keys: + description: 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. + example: + - '' + items: + type: string + type: array + required: + - fields + - primary_keys + type: object + CreateTableRequestDataAttributesSchemaFieldsItems: + description: The definition of `CreateTableRequestDataAttributesSchemaFieldsItems` + object. + properties: + name: + description: The field name. + example: '' + type: string + type: + $ref: '#/components/schemas/ReferenceTableSchemaFieldType' + required: + - name + - type + type: object + CreateTableRequestDataType: + default: reference_table + description: Reference table resource type. + enum: + - reference_table + example: reference_table + type: string + x-enum-varnames: + - REFERENCE_TABLE + CreateUploadRequest: + description: The definition of `CreateUploadRequest` object. + properties: + data: + $ref: '#/components/schemas/CreateUploadRequestData' + type: object + CreateUploadRequestData: + description: The definition of `CreateUploadRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateUploadRequestDataAttributes' + id: + description: The ID of the upload. + type: string + type: + $ref: '#/components/schemas/CreateUploadRequestDataType' + required: + - type + type: object + CreateUploadRequestDataAttributes: + description: The definition of `CreateUploadRequestDataAttributes` object. + properties: + headers: + description: The headers of the file to upload. + example: + - '' + items: + type: string + type: array + part_count: + description: The number of parts in the upload. + example: 3 + format: int32 + maximum: 20 + type: integer + part_size: + description: The size of each part in the upload in bytes. For multipart + uploads (part_count > 1), all parts except the last one must be at least + 5,000,000 bytes. For single-part uploads (part_count = 1), any size is + allowed. + example: 10000000 + format: int64 + type: integer + table_name: + description: The name of the reference table. + example: '' + type: string + required: + - headers + - table_name + - part_count + - part_size + type: object + CreateUploadRequestDataType: + default: upload + description: Upload resource type. + enum: + - upload + example: upload + type: string + x-enum-varnames: + - UPLOAD + CreateUploadResponse: + description: The definition of `CreateUploadResponse` object. + properties: + data: + $ref: '#/components/schemas/CreateUploadResponseData' + type: object + CreateUploadResponseData: + description: The definition of `CreateUploadResponseData` object. + properties: + attributes: + $ref: '#/components/schemas/CreateUploadResponseDataAttributes' + id: + description: The ID of the upload. + type: string + type: + $ref: '#/components/schemas/CreateUploadResponseDataType' + required: + - type + type: object + CreateUploadResponseDataAttributes: + description: The definition of `CreateUploadResponseDataAttributes` object. + properties: + part_urls: + description: The URLs of the parts in the upload. + items: + type: string + type: array + type: object + CreateUploadResponseDataType: + default: upload + description: Upload resource type. + enum: + - upload + example: upload + type: string + x-enum-varnames: + - UPLOAD CreateWorkflowRequest: description: A request object for creating a new workflow. example: @@ -35482,6 +35825,225 @@ components: version: $ref: '#/components/schemas/Version' type: object + PatchTableRequest: + description: The definition of `PatchTableRequest` object. + 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: id + type: INT32 + - name: name + type: STRING + primary_keys: + - id + sync_enabled: false + tags: + - test_tag + id: 00000000-0000-0000-0000-000000000000 + type: reference_table + properties: + data: + $ref: '#/components/schemas/PatchTableRequestData' + type: object + PatchTableRequestData: + description: The definition of `PatchTableRequestData` object. + properties: + attributes: + $ref: '#/components/schemas/PatchTableRequestDataAttributes' + id: + description: The ID of the reference table. + type: string + type: + $ref: '#/components/schemas/PatchTableRequestDataType' + required: + - type + type: object + PatchTableRequestDataAttributes: + description: The definition of `PatchTableRequestDataAttributes` object. + properties: + description: + description: The description of the reference table. + type: string + file_metadata: + $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadata' + schema: + $ref: '#/components/schemas/PatchTableRequestDataAttributesSchema' + sync_enabled: + description: Whether this table is synced automatically. + type: boolean + tags: + description: The tags of the reference table. + items: + type: string + type: array + type: object + PatchTableRequestDataAttributesFileMetadata: + description: The definition of `PatchTableRequestDataAttributesFileMetadata` + object. + oneOf: + - $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataCloudStorage' + - $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataLocalFile' + PatchTableRequestDataAttributesFileMetadataCloudStorage: + additionalProperties: false + description: Cloud storage file metadata for patch requests. Allows partial + updates of access_details and sync_enabled. + properties: + access_details: + $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails' + sync_enabled: + description: Whether this table is synced automatically. + example: false + type: boolean + title: CloudFileMetadataV2 + type: object + PatchTableRequestDataAttributesFileMetadataLocalFile: + additionalProperties: false + description: Local file metadata for patch requests using upload ID. + properties: + upload_id: + description: The upload ID. + example: '' + type: string + required: + - upload_id + title: LocalFileMetadataV2 + type: object + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails: + description: The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails` + object. + properties: + aws_detail: + $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail' + azure_detail: + $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail' + gcp_detail: + $ref: '#/components/schemas/PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + type: object + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail: + description: The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` + object. + properties: + aws_account_id: + description: The ID of the AWS account. + example: '123456789000' + type: string + aws_bucket_name: + description: The name of the AWS bucket. + example: example-data-bucket + type: string + file_path: + description: The relative file path from the S3 bucket root to the CSV file. + example: reference-tables/users.csv + type: string + type: object + x-oneOf-parent: + - AwsDetail + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail: + description: The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` + object. + properties: + azure_client_id: + description: The Azure client ID. + example: aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb + type: string + azure_container_name: + description: The name of the Azure container. + example: reference-data + type: string + azure_storage_account_name: + description: The name of the Azure storage account. + example: examplestorageaccount + type: string + azure_tenant_id: + description: The ID of the Azure tenant. + example: cccccccc-4444-5555-6666-dddddddddddd + type: string + file_path: + description: The relative file path from the Azure container root to the + CSV file. + example: tables/users.csv + type: string + type: object + x-oneOf-parent: + - AzureDetail + PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail: + description: The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` + object. + properties: + file_path: + description: The relative file path from the GCS bucket root to the CSV + file. + example: data/reference_tables/users.csv + type: string + gcp_bucket_name: + description: The name of the GCP bucket. + example: example-data-bucket + type: string + gcp_project_id: + description: The ID of the GCP project. + example: example-gcp-project-12345 + type: string + gcp_service_account_email: + description: The email of the GCP service account. + example: example-service@example-gcp-project-12345.iam.gserviceaccount.com + type: string + type: object + x-oneOf-parent: + - GcpDetail + PatchTableRequestDataAttributesSchema: + description: The definition of `PatchTableRequestDataAttributesSchema` object. + properties: + fields: + description: The `schema` `fields`. + items: + $ref: '#/components/schemas/PatchTableRequestDataAttributesSchemaFieldsItems' + type: array + primary_keys: + description: 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. + example: + - '' + items: + type: string + type: array + required: + - fields + - primary_keys + type: object + PatchTableRequestDataAttributesSchemaFieldsItems: + description: The definition of `PatchTableRequestDataAttributesSchemaFieldsItems` + object. + properties: + name: + description: The field name. + example: '' + type: string + type: + $ref: '#/components/schemas/ReferenceTableSchemaFieldType' + required: + - name + - type + type: object + PatchTableRequestDataType: + default: reference_table + description: Reference table resource type. + enum: + - reference_table + example: reference_table + type: string + x-enum-varnames: + - REFERENCE_TABLE Permission: description: Permission object. properties: @@ -37099,6 +37661,73 @@ components: type: string x-enum-varnames: - RECOMMENDATION + ReferenceTableCreateSourceType: + description: The source type for creating reference table data. Only these source + types can be created through this API. + enum: + - LOCAL_FILE + - S3 + - GCS + - AZURE + example: LOCAL_FILE + type: string + x-enum-varnames: + - LOCAL_FILE + - S3 + - GCS + - AZURE + ReferenceTableSchemaFieldType: + description: The field type for reference table schema fields. + enum: + - STRING + - INT32 + example: STRING + type: string + x-enum-varnames: + - STRING + - INT32 + ReferenceTableSortType: + default: -updated_at + description: Sort field and direction for reference tables. Use field name for + ascending, prefix with "-" for descending. + enum: + - updated_at + - table_name + - status + - -updated_at + - -table_name + - -status + type: string + x-enum-varnames: + - UPDATED_AT + - TABLE_NAME + - STATUS + - MINUS_UPDATED_AT + - MINUS_TABLE_NAME + - MINUS_STATUS + ReferenceTableSourceType: + description: The source type for reference table data. Includes all possible + source types that can appear in responses. + enum: + - LOCAL_FILE + - S3 + - GCS + - AZURE + - SERVICENOW + - SALESFORCE + - DATABRICKS + - SNOWFLAKE + example: LOCAL_FILE + type: string + x-enum-varnames: + - LOCAL_FILE + - S3 + - GCS + - AZURE + - SERVICENOW + - SALESFORCE + - DATABRICKS + - SNOWFLAKE RegisterAppKeyResponse: description: The response object after creating an app key registration. properties: @@ -47003,6 +47632,394 @@ components: format: double type: number type: object + TableResultV2: + description: The definition of `TableResultV2` object. + example: + data: + attributes: + created_by: 00000000-0000-0000-0000-000000000000 + description: example description + file_metadata: + access_details: {} + upload_id: 00000000-0000-0000-0000-000000000000 + last_updated_by: '' + row_count: 5 + schema: + fields: + - name: id + type: INT32 + - name: name + type: STRING + primary_keys: + - id + source: LOCAL_FILE + status: DONE + table_name: test_reference_table + tags: + - tag1 + - tag2 + updated_at: '2000-01-01T01:00:00+00:00' + id: 00000000-0000-0000-0000-000000000000 + type: reference_table + properties: + data: + $ref: '#/components/schemas/TableResultV2Data' + type: object + TableResultV2Array: + description: The definition of `TableResultV2Array` object. + example: + data: + - attributes: + created_by: 00000000-0000-0000-0000-000000000000 + description: example description + file_metadata: + access_details: {} + error_message: '' + error_row_count: 0 + upload_id: 00000000-0000-0000-0000-000000000000 + last_updated_by: '' + row_count: 5 + schema: + fields: + - name: id + type: INT32 + - name: name + type: STRING + primary_keys: + - id + source: LOCAL_FILE + status: DONE + table_name: test_reference_table + tags: + - tag1 + - tag2 + updated_at: '2000-01-01T01:00:00+00:00' + id: 00000000-0000-0000-0000-000000000000 + type: reference_table + - attributes: + created_by: 00000000-0000-0000-0000-000000000000 + description: example description + file_metadata: + access_details: + aws_detail: + aws_account_id: test-account-id + aws_bucket_name: test-bucket + file_path: test_rt.csv + error_message: '' + error_row_count: 0 + sync_enabled: true + last_updated_by: 00000000-0000-0000-0000-000000000000 + row_count: 5 + schema: + fields: + - name: location + type: STRING + - name: file_name + type: STRING + primary_keys: + - location + source: S3 + status: DONE + table_name: test_reference_table_2 + tags: + - test_tag1 + - tag2 + - '3' + updated_at: '2000-01-01T01:00:00+00:00' + id: 00000000-0000-0000-0000-000000000000 + type: reference_table + properties: + data: + description: The reference tables. + items: + $ref: '#/components/schemas/TableResultV2Data' + type: array + required: + - data + type: object + TableResultV2Data: + description: The definition of `TableResultV2Data` object. + properties: + attributes: + $ref: '#/components/schemas/TableResultV2DataAttributes' + id: + description: The ID of the reference table. + type: string + type: + $ref: '#/components/schemas/TableResultV2DataType' + required: + - type + type: object + TableResultV2DataAttributes: + description: The definition of `TableResultV2DataAttributes` object. + properties: + created_by: + description: UUID of the user who created the reference table. + type: string + description: + description: The description of the reference table. + type: string + file_metadata: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadata' + last_updated_by: + description: UUID of the user who last updated the reference table. + type: string + row_count: + description: The number of successfully processed rows in the reference + table. + format: int64 + type: integer + schema: + $ref: '#/components/schemas/TableResultV2DataAttributesSchema' + source: + $ref: '#/components/schemas/ReferenceTableSourceType' + status: + description: The status of the reference table. + type: string + table_name: + description: The name of the reference table. + type: string + tags: + description: The tags of the reference table. + items: + type: string + type: array + updated_at: + description: The timestamp of the last update to the reference table in + ISO 8601 format. + type: string + type: object + TableResultV2DataAttributesFileMetadata: + description: The definition of `TableResultV2DataAttributesFileMetadata` object. + oneOf: + - $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorage' + - $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataLocalFile' + TableResultV2DataAttributesFileMetadataCloudStorage: + description: File metadata for reference tables created by cloud storage. + properties: + access_details: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetails' + error_message: + description: The error message returned from the sync. + type: string + error_row_count: + description: The number of rows that failed to sync. + format: int64 + type: integer + error_type: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataCloudStorageErrorType' + sync_enabled: + description: Whether this table is synced automatically. + type: boolean + title: CloudFileMetadataV2 + type: object + TableResultV2DataAttributesFileMetadataCloudStorageErrorType: + description: 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. + enum: + - TABLE_SCHEMA_ERROR + - FILE_FORMAT_ERROR + - CONFIGURATION_ERROR + - QUOTA_EXCEEDED + - CONFLICT_ERROR + - VALIDATION_ERROR + - STATE_ERROR + - OPERATION_ERROR + - SYSTEM_ERROR + type: string + x-enum-varnames: + - TABLE_SCHEMA_ERROR + - FILE_FORMAT_ERROR + - CONFIGURATION_ERROR + - QUOTA_EXCEEDED + - CONFLICT_ERROR + - VALIDATION_ERROR + - STATE_ERROR + - OPERATION_ERROR + - SYSTEM_ERROR + TableResultV2DataAttributesFileMetadataLocalFile: + description: File metadata for reference tables created by upload. + 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 + upload_id: + description: The upload ID that was used to create/update the table. + type: string + title: LocalFileMetadataV2 + type: object + TableResultV2DataAttributesFileMetadataOneOfAccessDetails: + description: The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetails` + object. + properties: + aws_detail: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail' + azure_detail: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail' + gcp_detail: + $ref: '#/components/schemas/TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + type: object + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail: + description: The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail` + object. + properties: + aws_account_id: + description: The ID of the AWS account. + example: '123456789000' + type: string + aws_bucket_name: + description: The name of the AWS bucket. + example: example-data-bucket + type: string + file_path: + description: The relative file path from the S3 bucket root to the CSV file. + example: reference-tables/users.csv + type: string + type: object + x-oneOf-parent: + - AwsDetail + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail: + description: The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail` + object. + properties: + azure_client_id: + description: The Azure client ID. + example: aaaaaaaa-1111-2222-3333-bbbbbbbbbbbb + type: string + azure_container_name: + description: The name of the Azure container. + example: reference-data + type: string + azure_storage_account_name: + description: The name of the Azure storage account. + example: examplestorageaccount + type: string + azure_tenant_id: + description: The ID of the Azure tenant. + example: cccccccc-4444-5555-6666-dddddddddddd + type: string + file_path: + description: The relative file path from the Azure container root to the + CSV file. + example: tables/users.csv + type: string + type: object + x-oneOf-parent: + - AzureDetail + TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail: + description: The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail` + object. + properties: + file_path: + description: The relative file path from the GCS bucket root to the CSV + file. + example: data/reference_tables/users.csv + type: string + gcp_bucket_name: + description: The name of the GCP bucket. + example: example-data-bucket + type: string + gcp_project_id: + description: The ID of the GCP project. + example: example-gcp-project-12345 + type: string + gcp_service_account_email: + description: The email of the GCP service account. + example: example-service@example-gcp-project-12345.iam.gserviceaccount.com + type: string + type: object + x-oneOf-parent: + - GcpDetail + TableResultV2DataAttributesSchema: + description: The definition of `TableResultV2DataAttributesSchema` object. + properties: + fields: + description: The `schema` `fields`. + items: + $ref: '#/components/schemas/TableResultV2DataAttributesSchemaFieldsItems' + type: array + primary_keys: + description: 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. + example: + - '' + items: + type: string + type: array + required: + - fields + - primary_keys + type: object + TableResultV2DataAttributesSchemaFieldsItems: + description: The definition of `TableResultV2DataAttributesSchemaFieldsItems` + object. + properties: + name: + description: The field name. + example: '' + type: string + type: + $ref: '#/components/schemas/ReferenceTableSchemaFieldType' + required: + - name + - type + type: object + TableResultV2DataType: + default: reference_table + description: Reference table resource type. + enum: + - reference_table + example: reference_table + type: string + x-enum-varnames: + - REFERENCE_TABLE + TableRowResourceArray: + description: The definition of `TableRowResourceArray` object. + properties: + data: + description: The rows. + items: + $ref: '#/components/schemas/TableRowResourceData' + type: array + required: + - data + type: object + TableRowResourceData: + description: The definition of `TableRowResourceData` object. + properties: + attributes: + $ref: '#/components/schemas/TableRowResourceDataAttributes' + id: + description: The ID of the row. + type: string + type: + $ref: '#/components/schemas/TableRowResourceDataType' + required: + - type + type: object + TableRowResourceDataAttributes: + description: The definition of `TableRowResourceDataAttributes` object. + properties: + values: + additionalProperties: {} + description: The values of the row. + type: object + type: object + TableRowResourceDataType: + default: row + description: Row resource type. + enum: + - row + example: row + type: string + x-enum-varnames: + - ROW TagFilter: description: Tag filter for the budget's entries. properties: @@ -66728,6 +67745,284 @@ paths: operator: OR permissions: - timeseries_query + /api/v2/reference-tables/tables: + get: + description: List all reference tables in this organization. + operationId: ListTables + parameters: + - description: Number of tables to return. + example: 15 + in: query + name: limit + required: false + schema: + default: 15 + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: Number of tables to skip for pagination. + example: 0 + in: query + name: offset + required: false + schema: + default: 0 + format: int64 + minimum: 0 + type: integer + - description: Sort field and direction. Use field name for ascending, prefix + with "-" for descending. + example: -updated_at + in: query + name: sort + required: false + schema: + $ref: '#/components/schemas/ReferenceTableSortType' + - description: Filter by table status. + example: DONE + in: query + name: filter[status] + required: false + schema: + type: string + - description: Filter by exact table name match. + example: my_reference_table + in: query + name: filter[table_name][exact] + required: false + schema: + type: string + - description: Filter by table name containing substring. + example: user + in: query + name: filter[table_name][contains] + required: false + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TableResultV2Array' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: List tables + tags: + - Reference Tables + post: + description: '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).' + operationId: CreateReferenceTable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateTableRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/TableResultV2' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create reference table + tags: + - Reference Tables + /api/v2/reference-tables/tables/{id}: + delete: + description: Delete a reference table by ID + operationId: DeleteTable + parameters: + - description: The ID of the reference table to delete + in: path + name: id + required: true + schema: + type: string + responses: + '200': + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Delete table + tags: + - Reference Tables + get: + description: Get a reference table by ID + operationId: GetTable + parameters: + - description: The ID of the reference table to retrieve + in: path + name: id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TableResultV2' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get table + tags: + - Reference Tables + patch: + description: '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.' + operationId: UpdateReferenceTable + parameters: + - description: The ID of the reference table to update + in: path + name: id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PatchTableRequest' + required: true + responses: + '200': + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Update reference table + tags: + - Reference Tables + /api/v2/reference-tables/tables/{id}/rows: + get: + description: Get reference table rows by their primary key values. + operationId: GetRowsByID + parameters: + - description: The ID of the reference table + example: table-123 + in: path + name: id + required: true + schema: + type: string + - description: List of row IDs (primary key values) to retrieve from the reference + table. + example: + - row1 + - row2 + explode: true + in: query + name: row_id + required: true + schema: + items: + type: string + type: array + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TableRowResourceArray' + description: Some or all requested rows were found. + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Get rows by id + tags: + - Reference Tables + /api/v2/reference-tables/uploads: + post: + description: Create a reference table upload for bulk data ingestion + operationId: CreateReferenceTableUpload + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUploadRequest' + required: true + responses: + '201': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateUploadResponse' + description: Created + '400': + $ref: '#/components/responses/BadRequestResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] + summary: Create reference table upload + tags: + - Reference Tables /api/v2/remote_config/products/asm/waf/custom_rules: get: description: Retrieve a list of WAF custom rule. @@ -76923,6 +78218,8 @@ tags: aggregate your RUM events over HTTP. See the [RUM & Session Replay page](https://docs.datadoghq.com/real_user_monitoring/) for more information name: RUM +- description: Auto-generated tag Reference Tables + name: Reference Tables - description: 'A restriction policy defines the access control rules for a resource, mapping a set of relations diff --git a/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.frozen b/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.frozen new file mode 100644 index 00000000000..2e6c5cff613 --- /dev/null +++ b/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.frozen @@ -0,0 +1 @@ +2025-10-01T20:51:23.877Z \ No newline at end of file diff --git a/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.yml b/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.yml new file mode 100644 index 00000000000..07967658c6f --- /dev/null +++ b/cassettes/features/v2/reference_tables/Create-reference-table-without-upload-or-access-details-returns-Bad-Request-response.yml @@ -0,0 +1,26 @@ +http_interactions: +- recorded_at: Wed, 01 Oct 2025 20:51:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"description":"Test reference table without + upload or access details","schema":{"fields":[{"name":"id","type":"STRING"}],"primary_keys":["id"]},"source":"LOCAL_FILE","table_name":"test_invalid_table_Test-Create_reference_table_without_upload_or_access_details_returns_Bad_Request_response-1759351883","tags":["test_tag"]},"type":"reference_table"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/reference-tables/tables + response: + body: + encoding: UTF-8 + string: '{"errors":[{"title":"Generic Error","detail":"upload_id is required + for tables with ''LOCAL_FILE'' source"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 400 + message: Bad Request +recorded_with: VCR 6.0.0 diff --git a/examples/v2/reference-tables/CreateReferenceTable.rb b/examples/v2/reference-tables/CreateReferenceTable.rb new file mode 100644 index 00000000000..af69feb5f32 --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTable.rb @@ -0,0 +1,44 @@ +# Create reference table returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new + +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", + }), + }), + sync_enabled: true, + }), + schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({ + fields: [ + DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ + name: "name", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, + }), + DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ + name: "account_id", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, + }), + ], + primary_keys: [ + "account_id", + ], + }), + source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::S3, + table_name: "test_reference_table", + tags: [ + "test_tag", + ], + }), + type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE, + }), +}) +p api_instance.create_reference_table(body) diff --git a/examples/v2/reference-tables/CreateReferenceTableUpload.rb b/examples/v2/reference-tables/CreateReferenceTableUpload.rb new file mode 100644 index 00000000000..9a1213cc786 --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTableUpload.rb @@ -0,0 +1,21 @@ +# Create reference table upload returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new + +body = DatadogAPIClient::V2::CreateUploadRequest.new({ + data: DatadogAPIClient::V2::CreateUploadRequestData.new({ + attributes: DatadogAPIClient::V2::CreateUploadRequestDataAttributes.new({ + headers: [ + "id", + "name", + "value", + ], + table_name: "test_upload_table_Example-Reference-Table", + part_count: 1, + part_size: 1024, + }), + type: DatadogAPIClient::V2::CreateUploadRequestDataType::UPLOAD, + }), +}) +p api_instance.create_reference_table_upload(body) diff --git a/examples/v2/reference-tables/CreateReferenceTable_3196130987.rb b/examples/v2/reference-tables/CreateReferenceTable_3196130987.rb new file mode 100644 index 00000000000..d5792010bff --- /dev/null +++ b/examples/v2/reference-tables/CreateReferenceTable_3196130987.rb @@ -0,0 +1,41 @@ +# Create reference table with upload returns "Created" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new + +body = DatadogAPIClient::V2::CreateTableRequest.new({ + data: DatadogAPIClient::V2::CreateTableRequestData.new({ + attributes: DatadogAPIClient::V2::CreateTableRequestDataAttributes.new({ + description: "Test reference table created via BDD test Example-Reference-Table", + source: DatadogAPIClient::V2::ReferenceTableCreateSourceType::LOCAL_FILE, + file_metadata: DatadogAPIClient::V2::CreateTableRequestDataAttributesFileMetadataLocalFile.new({ + upload_id: "test-upload-id-Example-Reference-Table", + }), + schema: DatadogAPIClient::V2::CreateTableRequestDataAttributesSchema.new({ + fields: [ + DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ + name: "id", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, + }), + DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ + name: "name", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, + }), + DatadogAPIClient::V2::CreateTableRequestDataAttributesSchemaFieldsItems.new({ + name: "value", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::INT32, + }), + ], + primary_keys: [ + "id", + ], + }), + table_name: "test_reference_table_Example-Reference-Table", + tags: [ + "test_tag", + ], + }), + type: DatadogAPIClient::V2::CreateTableRequestDataType::REFERENCE_TABLE, + }), +}) +p api_instance.create_reference_table(body) diff --git a/examples/v2/reference-tables/DeleteTable.rb b/examples/v2/reference-tables/DeleteTable.rb new file mode 100644 index 00000000000..44870b84633 --- /dev/null +++ b/examples/v2/reference-tables/DeleteTable.rb @@ -0,0 +1,5 @@ +# Delete table returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new +p api_instance.delete_table("id") diff --git a/examples/v2/reference-tables/GetRowsByID.rb b/examples/v2/reference-tables/GetRowsByID.rb new file mode 100644 index 00000000000..59436730fc9 --- /dev/null +++ b/examples/v2/reference-tables/GetRowsByID.rb @@ -0,0 +1,5 @@ +# Get rows by id returns "Some or all requested rows were found." response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new +p api_instance.get_rows_by_id("id", []) diff --git a/examples/v2/reference-tables/GetTable.rb b/examples/v2/reference-tables/GetTable.rb new file mode 100644 index 00000000000..4c0266feedc --- /dev/null +++ b/examples/v2/reference-tables/GetTable.rb @@ -0,0 +1,5 @@ +# Get table returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new +p api_instance.get_table("id") diff --git a/examples/v2/reference-tables/ListTables.rb b/examples/v2/reference-tables/ListTables.rb new file mode 100644 index 00000000000..4ce11b25aa4 --- /dev/null +++ b/examples/v2/reference-tables/ListTables.rb @@ -0,0 +1,5 @@ +# List tables returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new +p api_instance.list_tables() diff --git a/examples/v2/reference-tables/UpdateReferenceTable.rb b/examples/v2/reference-tables/UpdateReferenceTable.rb new file mode 100644 index 00000000000..31d18341364 --- /dev/null +++ b/examples/v2/reference-tables/UpdateReferenceTable.rb @@ -0,0 +1,44 @@ +# Update reference table returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new + +body = DatadogAPIClient::V2::PatchTableRequest.new({ + data: DatadogAPIClient::V2::PatchTableRequestData.new({ + attributes: DatadogAPIClient::V2::PatchTableRequestDataAttributes.new({ + description: "this is a cloud table generated via a cloud bucket sync", + file_metadata: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataCloudStorage.new({ + access_details: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails.new({ + aws_detail: DatadogAPIClient::V2::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail.new({ + aws_account_id: "test-account-id", + aws_bucket_name: "test-bucket", + file_path: "test_rt.csv", + }), + }), + sync_enabled: true, + }), + schema: DatadogAPIClient::V2::PatchTableRequestDataAttributesSchema.new({ + fields: [ + DatadogAPIClient::V2::PatchTableRequestDataAttributesSchemaFieldsItems.new({ + name: "id", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::INT32, + }), + DatadogAPIClient::V2::PatchTableRequestDataAttributesSchemaFieldsItems.new({ + name: "name", + type: DatadogAPIClient::V2::ReferenceTableSchemaFieldType::STRING, + }), + ], + primary_keys: [ + "id", + ], + }), + sync_enabled: false, + tags: [ + "test_tag", + ], + }), + id: "00000000-0000-0000-0000-000000000000", + type: DatadogAPIClient::V2::PatchTableRequestDataType::REFERENCE_TABLE, + }), +}) +p api_instance.update_reference_table("id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 5cbf5c8ea60..8d2a2a9c201 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2555,6 +2555,34 @@ "page_limit" => "Integer", "page_cursor" => "String", }, + "v2.ListTables" => { + "limit" => "Integer", + "offset" => "Integer", + "sort" => "ReferenceTableSortType", + "filter_status" => "String", + "filter_table_name_exact" => "String", + "filter_table_name_contains" => "String", + }, + "v2.CreateReferenceTable" => { + "body" => "CreateTableRequest", + }, + "v2.DeleteTable" => { + "id" => "String", + }, + "v2.GetTable" => { + "id" => "String", + }, + "v2.UpdateReferenceTable" => { + "id" => "String", + "body" => "PatchTableRequest", + }, + "v2.GetRowsByID" => { + "id" => "String", + "row_id" => "Array", + }, + "v2.CreateReferenceTableUpload" => { + "body" => "CreateUploadRequest", + }, "v2.CreateApplicationSecurityWafCustomRule" => { "body" => "ApplicationSecurityWafCustomRuleCreateRequest", }, diff --git a/features/v2/reference_tables.feature b/features/v2/reference_tables.feature new file mode 100644 index 00000000000..17e66019c05 --- /dev/null +++ b/features/v2/reference_tables.feature @@ -0,0 +1,121 @@ +@endpoint(reference-tables) @endpoint(reference-tables-v2) +Feature: Reference Tables + Auto-generated tag Reference Tables + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "ReferenceTables" API + + @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"}} + 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"}} + 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": [""], "part_count": 3, "part_size": 10000000, "table_name": ""}, "type": "upload"}} + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/redapl-experiences + Scenario: Create reference table upload returns "Created" response + Given new "CreateReferenceTableUpload" request + And body with value {"data": {"attributes": {"headers": ["id", "name", "value"], "table_name": "test_upload_table_{{ unique }}", "part_count": 1, "part_size": 1024}, "type": "upload"}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "upload" + And the response "data.attributes.table_name" is equal to "test_upload_table_{{ unique }}" + + @skip @team:DataDog/redapl-experiences + Scenario: Create reference table with upload returns "Created" response + Given new "CreateReferenceTable" request + And body with value {"data": {"attributes": {"description": "Test reference table created via BDD test {{ unique }}", "source": "LOCAL_FILE", "file_metadata": {"upload_id": "test-upload-id-{{ unique }}"}, "schema": {"fields": [{"name": "id", "type": "STRING"}, {"name": "name", "type": "STRING"}, {"name": "value", "type": "INT32"}], "primary_keys": ["id"]}, "table_name": "test_reference_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}} + When the request is sent + Then the response status is 201 Created + And the response "data.type" is equal to "reference_table" + And the response "data.attributes.table_name" is equal to "test_reference_table_{{ unique }}" + + @team:DataDog/redapl-experiences + Scenario: Create reference table without upload or access details returns "Bad Request" response + Given new "CreateReferenceTable" request + And body with value {"data": {"attributes": {"description": "Test reference table without upload or access details", "source": "LOCAL_FILE", "schema": {"fields": [{"name": "id", "type": "STRING"}], "primary_keys": ["id"]}, "table_name": "test_invalid_table_{{ unique }}", "tags": ["test_tag"]}, "type": "reference_table"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Delete table returns "Not Found" response + Given new "DeleteTable" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Delete table returns "OK" response + Given new "DeleteTable" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Get rows by id returns "Not Found" response + Given new "GetRowsByID" request + And request contains "id" parameter from "REPLACE.ME" + And request contains "row_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Get rows by id returns "Some or all requested rows were found." response + Given new "GetRowsByID" request + And request contains "id" parameter from "REPLACE.ME" + And request contains "row_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 Some or all requested rows were found. + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Get table returns "Not Found" response + Given new "GetTable" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Get table returns "OK" response + Given new "GetTable" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @skip @team:DataDog/redapl-experiences + Scenario: List tables returns "OK" response + Given new "ListTables" request + When the request is sent + Then the response status is 200 OK + And the response "data" has length 1 + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Update reference table returns "Bad Request" response + Given new "UpdateReferenceTable" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/redapl-experiences + Scenario: Update reference table returns "OK" response + Given new "UpdateReferenceTable" request + And request contains "id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"description": "this is a cloud table generated via a cloud bucket sync", "file_metadata": {"access_details": {"aws_detail": {"aws_account_id": "test-account-id", "aws_bucket_name": "test-bucket", "file_path": "test_rt.csv"}}, "sync_enabled": true}, "schema": {"fields": [{"name": "id", "type": "INT32"}, {"name": "name", "type": "STRING"}], "primary_keys": ["id"]}, "sync_enabled": false, "tags": ["test_tag"]}, "id": "00000000-0000-0000-0000-000000000000", "type": "reference_table"}} + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index c4c269d3cab..f57ef906513 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2641,6 +2641,55 @@ "type": "idempotent" } }, + "ListTables": { + "tag": "Reference Tables", + "undo": { + "type": "safe" + } + }, + "CreateReferenceTable": { + "tag": "Reference Tables", + "undo": { + "operationId": "DeleteTable", + "parameters": [ + { + "name": "id", + "source": "data.id" + } + ], + "type": "unsafe" + } + }, + "DeleteTable": { + "tag": "Reference Tables", + "undo": { + "type": "idempotent" + } + }, + "GetTable": { + "tag": "Reference Tables", + "undo": { + "type": "safe" + } + }, + "UpdateReferenceTable": { + "tag": "Reference Tables", + "undo": { + "type": "idempotent" + } + }, + "GetRowsByID": { + "tag": "Reference Tables", + "undo": { + "type": "safe" + } + }, + "CreateReferenceTableUpload": { + "tag": "Reference Tables", + "undo": { + "type": "idempotent" + } + }, "ListApplicationSecurityWAFCustomRules": { "tag": "Application Security", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 5f593e64148..6ba4dd7a132 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -1636,6 +1636,27 @@ def overrides "v2.create_ruleset_request_data_attributes_rules_items_reference_table" => "CreateRulesetRequestDataAttributesRulesItemsReferenceTable", "v2.create_ruleset_request_data_attributes_rules_items_reference_table_field_pairs_items" => "CreateRulesetRequestDataAttributesRulesItemsReferenceTableFieldPairsItems", "v2.create_ruleset_request_data_type" => "CreateRulesetRequestDataType", + "v2.create_table_request" => "CreateTableRequest", + "v2.create_table_request_data" => "CreateTableRequestData", + "v2.create_table_request_data_attributes" => "CreateTableRequestDataAttributes", + "v2.create_table_request_data_attributes_file_metadata" => "CreateTableRequestDataAttributesFileMetadata", + "v2.create_table_request_data_attributes_file_metadata_cloud_storage" => "CreateTableRequestDataAttributesFileMetadataCloudStorage", + "v2.create_table_request_data_attributes_file_metadata_local_file" => "CreateTableRequestDataAttributesFileMetadataLocalFile", + "v2.create_table_request_data_attributes_file_metadata_one_of_access_details" => "CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails", + "v2.create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail" => "CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail", + "v2.create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail" => "CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail", + "v2.create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail" => "CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail", + "v2.create_table_request_data_attributes_schema" => "CreateTableRequestDataAttributesSchema", + "v2.create_table_request_data_attributes_schema_fields_items" => "CreateTableRequestDataAttributesSchemaFieldsItems", + "v2.create_table_request_data_type" => "CreateTableRequestDataType", + "v2.create_upload_request" => "CreateUploadRequest", + "v2.create_upload_request_data" => "CreateUploadRequestData", + "v2.create_upload_request_data_attributes" => "CreateUploadRequestDataAttributes", + "v2.create_upload_request_data_type" => "CreateUploadRequestDataType", + "v2.create_upload_response" => "CreateUploadResponse", + "v2.create_upload_response_data" => "CreateUploadResponseData", + "v2.create_upload_response_data_attributes" => "CreateUploadResponseDataAttributes", + "v2.create_upload_response_data_type" => "CreateUploadResponseDataType", "v2.create_workflow_request" => "CreateWorkflowRequest", "v2.create_workflow_response" => "CreateWorkflowResponse", "v2.creator" => "Creator", @@ -3146,6 +3167,19 @@ def overrides "v2.patch_notification_rule_parameters" => "PatchNotificationRuleParameters", "v2.patch_notification_rule_parameters_data" => "PatchNotificationRuleParametersData", "v2.patch_notification_rule_parameters_data_attributes" => "PatchNotificationRuleParametersDataAttributes", + "v2.patch_table_request" => "PatchTableRequest", + "v2.patch_table_request_data" => "PatchTableRequestData", + "v2.patch_table_request_data_attributes" => "PatchTableRequestDataAttributes", + "v2.patch_table_request_data_attributes_file_metadata" => "PatchTableRequestDataAttributesFileMetadata", + "v2.patch_table_request_data_attributes_file_metadata_cloud_storage" => "PatchTableRequestDataAttributesFileMetadataCloudStorage", + "v2.patch_table_request_data_attributes_file_metadata_local_file" => "PatchTableRequestDataAttributesFileMetadataLocalFile", + "v2.patch_table_request_data_attributes_file_metadata_one_of_access_details" => "PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails", + "v2.patch_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail" => "PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail", + "v2.patch_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail" => "PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail", + "v2.patch_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail" => "PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail", + "v2.patch_table_request_data_attributes_schema" => "PatchTableRequestDataAttributesSchema", + "v2.patch_table_request_data_attributes_schema_fields_items" => "PatchTableRequestDataAttributesSchemaFieldsItems", + "v2.patch_table_request_data_type" => "PatchTableRequestDataType", "v2.permission" => "Permission", "v2.permission_attributes" => "PermissionAttributes", "v2.permissions_response" => "PermissionsResponse", @@ -3198,6 +3232,10 @@ def overrides "v2.recommendation_data" => "RecommendationData", "v2.recommendation_document" => "RecommendationDocument", "v2.recommendation_type" => "RecommendationType", + "v2.reference_table_create_source_type" => "ReferenceTableCreateSourceType", + "v2.reference_table_schema_field_type" => "ReferenceTableSchemaFieldType", + "v2.reference_table_sort_type" => "ReferenceTableSortType", + "v2.reference_table_source_type" => "ReferenceTableSourceType", "v2.register_app_key_response" => "RegisterAppKeyResponse", "v2.relation_attributes" => "RelationAttributes", "v2.relation_entity" => "RelationEntity", @@ -3885,6 +3923,25 @@ def overrides "v2.step" => "Step", "v2.step_display" => "StepDisplay", "v2.step_display_bounds" => "StepDisplayBounds", + "v2.table_result_v2" => "TableResultV2", + "v2.table_result_v2_array" => "TableResultV2Array", + "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", + "v2.table_result_v2_data_attributes_file_metadata_one_of_access_details_gcp_detail" => "TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail", + "v2.table_result_v2_data_attributes_schema" => "TableResultV2DataAttributesSchema", + "v2.table_result_v2_data_attributes_schema_fields_items" => "TableResultV2DataAttributesSchemaFieldsItems", + "v2.table_result_v2_data_type" => "TableResultV2DataType", + "v2.table_row_resource_array" => "TableRowResourceArray", + "v2.table_row_resource_data" => "TableRowResourceData", + "v2.table_row_resource_data_attributes" => "TableRowResourceDataAttributes", + "v2.table_row_resource_data_type" => "TableRowResourceDataType", "v2.tag_filter" => "TagFilter", "v2.team" => "Team", "v2.team_attributes" => "TeamAttributes", @@ -4233,6 +4290,7 @@ def overrides "v2.organizations_api" => "OrganizationsAPI", "v2.powerpack_api" => "PowerpackAPI", "v2.processes_api" => "ProcessesAPI", + "v2.reference_tables_api" => "ReferenceTablesAPI", "v2.restriction_policies_api" => "RestrictionPoliciesAPI", "v2.roles_api" => "RolesAPI", "v2.rum_api" => "RUMAPI", diff --git a/lib/datadog_api_client/v2/api/reference_tables_api.rb b/lib/datadog_api_client/v2/api/reference_tables_api.rb new file mode 100644 index 00000000000..f671bd0c09c --- /dev/null +++ b/lib/datadog_api_client/v2/api/reference_tables_api.rb @@ -0,0 +1,519 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class ReferenceTablesAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Create reference table. + # + # @see #create_reference_table_with_http_info + def create_reference_table(body, opts = {}) + data, _status_code, _headers = create_reference_table_with_http_info(body, opts) + data + end + + # 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). + # + # @param body [CreateTableRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(TableResultV2, Integer, Hash)>] TableResultV2 data, response status code and response headers + def create_reference_table_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.create_reference_table ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ReferenceTablesAPI.create_reference_table" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'TableResultV2' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_reference_table, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#create_reference_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create reference table upload. + # + # @see #create_reference_table_upload_with_http_info + def create_reference_table_upload(body, opts = {}) + data, _status_code, _headers = create_reference_table_upload_with_http_info(body, opts) + data + end + + # Create reference table upload. + # + # Create a reference table upload for bulk data ingestion + # + # @param body [CreateUploadRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(CreateUploadResponse, Integer, Hash)>] CreateUploadResponse data, response status code and response headers + def create_reference_table_upload_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.create_reference_table_upload ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ReferenceTablesAPI.create_reference_table_upload" + end + # resource path + local_var_path = '/api/v2/reference-tables/uploads' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'CreateUploadResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_reference_table_upload, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#create_reference_table_upload\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Delete table. + # + # @see #delete_table_with_http_info + def delete_table(id, opts = {}) + delete_table_with_http_info(id, opts) + nil + end + + # Delete table. + # + # Delete a reference table by ID + # + # @param id [String] The ID 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 = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.delete_table ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ReferenceTablesAPI.delete_table" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_table, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#delete_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get rows by id. + # + # @see #get_rows_by_id_with_http_info + def get_rows_by_id(id, row_id, opts = {}) + data, _status_code, _headers = get_rows_by_id_with_http_info(id, row_id, opts) + data + end + + # Get rows by id. + # + # Get reference table rows by their primary key values. + # + # @param id [String] The ID of the reference table + # @param row_id [Array] 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 + def get_rows_by_id_with_http_info(id, row_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.get_rows_by_id ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ReferenceTablesAPI.get_rows_by_id" + end + # verify the required parameter 'row_id' is set + if @api_client.config.client_side_validation && row_id.nil? + fail ArgumentError, "Missing the required parameter 'row_id' when calling ReferenceTablesAPI.get_rows_by_id" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables/{id}/rows'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'row_id'] = @api_client.build_collection_param(row_id, :multi) + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TableRowResourceArray' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_rows_by_id, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + new_options[:query_string_normalizer] = HTTParty::Request::NON_RAILS_QUERY_STRING_NORMALIZER + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#get_rows_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get table. + # + # @see #get_table_with_http_info + def get_table(id, opts = {}) + data, _status_code, _headers = get_table_with_http_info(id, opts) + data + end + + # Get table. + # + # Get a reference table by ID + # + # @param id [String] The ID 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 = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.get_table ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ReferenceTablesAPI.get_table" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TableResultV2' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_table, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#get_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # List tables. + # + # @see #list_tables_with_http_info + def list_tables(opts = {}) + data, _status_code, _headers = list_tables_with_http_info(opts) + data + end + + # List tables. + # + # List all reference tables in this organization. + # + # @param opts [Hash] the optional parameters + # @option opts [Integer] :limit Number of tables to return. + # @option opts [Integer] :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 [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. + # @return [Array<(TableResultV2Array, Integer, Hash)>] TableResultV2Array data, response status code and response headers + def list_tables_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.list_tables ...' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReferenceTablesAPI.list_tables, must be smaller than or equal to 100.' + end + if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 + fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling ReferenceTablesAPI.list_tables, must be greater than or equal to 1.' + end + if @api_client.config.client_side_validation && !opts[:'offset'].nil? && opts[:'offset'] < 0 + fail ArgumentError, 'invalid value for "opts[:"offset"]" when calling ReferenceTablesAPI.list_tables, must be greater than or equal to 0.' + end + allowable_values = ['updated_at', 'table_name', 'status', '-updated_at', '-table_name', '-status'] + if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) + fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables' + + # query parameters + query_params = opts[:query_params] || {} + query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? + query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? + query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? + query_params[:'filter[status]'] = opts[:'filter_status'] if !opts[:'filter_status'].nil? + query_params[:'filter[table_name][exact]'] = opts[:'filter_table_name_exact'] if !opts[:'filter_table_name_exact'].nil? + query_params[:'filter[table_name][contains]'] = opts[:'filter_table_name_contains'] if !opts[:'filter_table_name_contains'].nil? + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'TableResultV2Array' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :list_tables, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#list_tables\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Update reference table. + # + # @see #update_reference_table_with_http_info + def update_reference_table(id, body, opts = {}) + update_reference_table_with_http_info(id, body, opts) + nil + end + + # Update reference table. + # + # 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 body [PatchTableRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def update_reference_table_with_http_info(id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: ReferenceTablesAPI.update_reference_table ...' + end + # verify the required parameter 'id' is set + if @api_client.config.client_side_validation && id.nil? + fail ArgumentError, "Missing the required parameter 'id' when calling ReferenceTablesAPI.update_reference_table" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling ReferenceTablesAPI.update_reference_table" + end + # resource path + local_var_path = '/api/v2/reference-tables/tables/{id}'.sub('{id}', CGI.escape(id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['*/*']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_reference_table, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: ReferenceTablesAPI#update_reference_table\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request.rb b/lib/datadog_api_client/v2/models/create_table_request.rb new file mode 100644 index 00000000000..c51aa5d8cfe --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `CreateTableRequest` object. + class CreateTableRequest + include BaseGenericModel + + # The definition of `CreateTableRequestData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateTableRequestData' + } + 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::CreateTableRequest` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data.rb b/lib/datadog_api_client/v2/models/create_table_request_data.rb new file mode 100644 index 00000000000..03614a894de --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `CreateTableRequestData` object. + class CreateTableRequestData + include BaseGenericModel + + # The definition of `CreateTableRequestDataAttributes` object. + attr_accessor :attributes + + # The ID of the reference table. + attr_accessor :id + + # Reference table resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateTableRequestDataAttributes', + :'id' => :'String', + :'type' => :'CreateTableRequestDataType' + } + 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::CreateTableRequestData` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes.rb new file mode 100644 index 00000000000..e924ff843f0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes.rb @@ -0,0 +1,197 @@ +=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 + # The definition of `CreateTableRequestDataAttributes` object. + class CreateTableRequestDataAttributes + include BaseGenericModel + + # The description of the reference table. + attr_accessor :description + + # The definition of `CreateTableRequestDataAttributesFileMetadata` object. + attr_accessor :file_metadata + + # The definition of `CreateTableRequestDataAttributesSchema` object. + 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. + attr_reader :table_name + + # The tags of the reference table. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'file_metadata' => :'file_metadata', + :'schema' => :'schema', + :'source' => :'source', + :'table_name' => :'table_name', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'file_metadata' => :'CreateTableRequestDataAttributesFileMetadata', + :'schema' => :'CreateTableRequestDataAttributesSchema', + :'source' => :'ReferenceTableCreateSourceType', + :'table_name' => :'String', + :'tags' => :'Array' + } + 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::CreateTableRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'file_metadata') + self.file_metadata = attributes[:'file_metadata'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'table_name') + self.table_name = attributes[:'table_name'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + 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 @schema.nil? + return false if @source.nil? + return false if @table_name.nil? + true + end + + # Custom attribute writer method with validation + # @param schema [Object] Object to be assigned + # @!visibility private + def schema=(schema) + if schema.nil? + fail ArgumentError, 'invalid value for "schema", schema cannot be nil.' + end + @schema = schema + end + + # Custom attribute writer method with validation + # @param source [Object] Object to be assigned + # @!visibility private + def source=(source) + if source.nil? + fail ArgumentError, 'invalid value for "source", source cannot be nil.' + end + @source = source + end + + # Custom attribute writer method with validation + # @param table_name [Object] Object to be assigned + # @!visibility private + def table_name=(table_name) + if table_name.nil? + fail ArgumentError, 'invalid value for "table_name", table_name cannot be nil.' + end + @table_name = table_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + description == o.description && + file_metadata == o.file_metadata && + schema == o.schema && + source == o.source && + table_name == o.table_name && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, file_metadata, schema, source, table_name, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata.rb new file mode 100644 index 00000000000..8bb539f0a8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata.rb @@ -0,0 +1,63 @@ +=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 + # The definition of `CreateTableRequestDataAttributesFileMetadata` object. + module CreateTableRequestDataAttributesFileMetadata + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'CreateTableRequestDataAttributesFileMetadataCloudStorage', + :'CreateTableRequestDataAttributesFileMetadataLocalFile' + ] + 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) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_cloud_storage.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_cloud_storage.rb new file mode 100644 index 00000000000..d6df3248c03 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_cloud_storage.rb @@ -0,0 +1,119 @@ +=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 + # Cloud storage file metadata for create requests. Both access_details and sync_enabled are required. + class CreateTableRequestDataAttributesFileMetadataCloudStorage + include BaseGenericModel + + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object. + attr_reader :access_details + + # Whether this table is synced automatically. + attr_reader :sync_enabled + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'access_details' => :'access_details', + :'sync_enabled' => :'sync_enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_details' => :'CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails', + :'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::CreateTableRequestDataAttributesFileMetadataCloudStorage` 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::CreateTableRequestDataAttributesFileMetadataCloudStorage`. 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?(:'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? + return false if @sync_enabled.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 + + # Custom attribute writer method with validation + # @param sync_enabled [Object] Object to be assigned + # @!visibility private + def sync_enabled=(sync_enabled) + if sync_enabled.nil? + fail ArgumentError, 'invalid value for "sync_enabled", sync_enabled cannot be nil.' + end + @sync_enabled = sync_enabled + 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 && + sync_enabled == o.sync_enabled + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_details, sync_enabled].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_local_file.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_local_file.rb new file mode 100644 index 00000000000..1425084c557 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_local_file.rb @@ -0,0 +1,98 @@ +=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 + # Local file metadata for create requests using the upload ID. + class CreateTableRequestDataAttributesFileMetadataLocalFile + include BaseGenericModel + + # The upload ID. + attr_reader :upload_id + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'upload_id' => :'upload_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'upload_id' => :'String' + } + 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::CreateTableRequestDataAttributesFileMetadataLocalFile` 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::CreateTableRequestDataAttributesFileMetadataLocalFile`. 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?(:'upload_id') + self.upload_id = attributes[:'upload_id'] + 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 @upload_id.nil? + true + end + + # Custom attribute writer method with validation + # @param upload_id [Object] Object to be assigned + # @!visibility private + def upload_id=(upload_id) + if upload_id.nil? + fail ArgumentError, 'invalid value for "upload_id", upload_id cannot be nil.' + end + @upload_id = upload_id + 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 && + upload_id == o.upload_id + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [upload_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details.rb new file mode 100644 index 00000000000..dc91255bc7a --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` object. + class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails + include BaseGenericModel + + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + attr_accessor :aws_detail + + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + attr_accessor :azure_detail + + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + attr_accessor :gcp_detail + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_detail' => :'aws_detail', + :'azure_detail' => :'azure_detail', + :'gcp_detail' => :'gcp_detail' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_detail' => :'CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail', + :'azure_detail' => :'CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail', + :'gcp_detail' => :'CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + } + 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::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetails` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_detail') + self.aws_detail = attributes[:'aws_detail'] + end + + if attributes.key?(:'azure_detail') + self.azure_detail = attributes[:'azure_detail'] + end + + if attributes.key?(:'gcp_detail') + self.gcp_detail = attributes[:'gcp_detail'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_detail == o.aws_detail && + azure_detail == o.azure_detail && + gcp_detail == o.gcp_detail && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_detail, azure_detail, gcp_detail, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb new file mode 100644 index 00000000000..ae0c7746371 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb @@ -0,0 +1,165 @@ +=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 + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + include BaseGenericModel + + # The ID of the AWS account. + attr_reader :aws_account_id + + # The name of the Amazon S3 bucket. + attr_reader :aws_bucket_name + + # The relative file path from the S3 bucket root to the CSV file. + attr_reader :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_account_id' => :'aws_account_id', + :'aws_bucket_name' => :'aws_bucket_name', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_account_id' => :'String', + :'aws_bucket_name' => :'String', + :'file_path' => :'String' + } + 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::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_bucket_name') + self.aws_bucket_name = attributes[:'aws_bucket_name'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + 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 @aws_account_id.nil? + return false if @aws_bucket_name.nil? + return false if @file_path.nil? + true + end + + # Custom attribute writer method with validation + # @param aws_account_id [Object] Object to be assigned + # @!visibility private + def aws_account_id=(aws_account_id) + if aws_account_id.nil? + fail ArgumentError, 'invalid value for "aws_account_id", aws_account_id cannot be nil.' + end + @aws_account_id = aws_account_id + end + + # Custom attribute writer method with validation + # @param aws_bucket_name [Object] Object to be assigned + # @!visibility private + def aws_bucket_name=(aws_bucket_name) + if aws_bucket_name.nil? + fail ArgumentError, 'invalid value for "aws_bucket_name", aws_bucket_name cannot be nil.' + end + @aws_bucket_name = aws_bucket_name + end + + # Custom attribute writer method with validation + # @param file_path [Object] Object to be assigned + # @!visibility private + def file_path=(file_path) + if file_path.nil? + fail ArgumentError, 'invalid value for "file_path", file_path cannot be nil.' + end + @file_path = file_path + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_account_id == o.aws_account_id && + aws_bucket_name == o.aws_bucket_name && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_account_id, aws_bucket_name, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb new file mode 100644 index 00000000000..5bf5d397982 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb @@ -0,0 +1,207 @@ +=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 + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + class CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + include BaseGenericModel + + # The Azure client ID. + attr_reader :azure_client_id + + # The name of the Azure container. + attr_reader :azure_container_name + + # The name of the Azure storage account. + attr_reader :azure_storage_account_name + + # The ID of the Azure tenant. + attr_reader :azure_tenant_id + + # The relative file path from the Azure container root to the CSV file. + attr_reader :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'azure_client_id' => :'azure_client_id', + :'azure_container_name' => :'azure_container_name', + :'azure_storage_account_name' => :'azure_storage_account_name', + :'azure_tenant_id' => :'azure_tenant_id', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'azure_client_id' => :'String', + :'azure_container_name' => :'String', + :'azure_storage_account_name' => :'String', + :'azure_tenant_id' => :'String', + :'file_path' => :'String' + } + 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::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'azure_client_id') + self.azure_client_id = attributes[:'azure_client_id'] + end + + if attributes.key?(:'azure_container_name') + self.azure_container_name = attributes[:'azure_container_name'] + end + + if attributes.key?(:'azure_storage_account_name') + self.azure_storage_account_name = attributes[:'azure_storage_account_name'] + end + + if attributes.key?(:'azure_tenant_id') + self.azure_tenant_id = attributes[:'azure_tenant_id'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + 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 @azure_client_id.nil? + return false if @azure_container_name.nil? + return false if @azure_storage_account_name.nil? + return false if @azure_tenant_id.nil? + return false if @file_path.nil? + true + end + + # Custom attribute writer method with validation + # @param azure_client_id [Object] Object to be assigned + # @!visibility private + def azure_client_id=(azure_client_id) + if azure_client_id.nil? + fail ArgumentError, 'invalid value for "azure_client_id", azure_client_id cannot be nil.' + end + @azure_client_id = azure_client_id + end + + # Custom attribute writer method with validation + # @param azure_container_name [Object] Object to be assigned + # @!visibility private + def azure_container_name=(azure_container_name) + if azure_container_name.nil? + fail ArgumentError, 'invalid value for "azure_container_name", azure_container_name cannot be nil.' + end + @azure_container_name = azure_container_name + end + + # Custom attribute writer method with validation + # @param azure_storage_account_name [Object] Object to be assigned + # @!visibility private + def azure_storage_account_name=(azure_storage_account_name) + if azure_storage_account_name.nil? + fail ArgumentError, 'invalid value for "azure_storage_account_name", azure_storage_account_name cannot be nil.' + end + @azure_storage_account_name = azure_storage_account_name + end + + # Custom attribute writer method with validation + # @param azure_tenant_id [Object] Object to be assigned + # @!visibility private + def azure_tenant_id=(azure_tenant_id) + if azure_tenant_id.nil? + fail ArgumentError, 'invalid value for "azure_tenant_id", azure_tenant_id cannot be nil.' + end + @azure_tenant_id = azure_tenant_id + end + + # Custom attribute writer method with validation + # @param file_path [Object] Object to be assigned + # @!visibility private + def file_path=(file_path) + if file_path.nil? + fail ArgumentError, 'invalid value for "file_path", file_path cannot be nil.' + end + @file_path = file_path + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + azure_client_id == o.azure_client_id && + azure_container_name == o.azure_container_name && + azure_storage_account_name == o.azure_storage_account_name && + azure_tenant_id == o.azure_tenant_id && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [azure_client_id, azure_container_name, azure_storage_account_name, azure_tenant_id, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb new file mode 100644 index 00000000000..d4b921d0000 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb @@ -0,0 +1,186 @@ +=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 + # The definition of `CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + 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. + attr_reader :gcp_bucket_name + + # The ID of the GCP project. + attr_reader :gcp_project_id + + # The email of the GCP service account. + attr_reader :gcp_service_account_email + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file_path' => :'file_path', + :'gcp_bucket_name' => :'gcp_bucket_name', + :'gcp_project_id' => :'gcp_project_id', + :'gcp_service_account_email' => :'gcp_service_account_email' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file_path' => :'String', + :'gcp_bucket_name' => :'String', + :'gcp_project_id' => :'String', + :'gcp_service_account_email' => :'String' + } + 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::CreateTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'gcp_bucket_name') + self.gcp_bucket_name = attributes[:'gcp_bucket_name'] + end + + if attributes.key?(:'gcp_project_id') + self.gcp_project_id = attributes[:'gcp_project_id'] + end + + if attributes.key?(:'gcp_service_account_email') + self.gcp_service_account_email = attributes[:'gcp_service_account_email'] + 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 @file_path.nil? + return false if @gcp_bucket_name.nil? + return false if @gcp_project_id.nil? + return false if @gcp_service_account_email.nil? + true + end + + # Custom attribute writer method with validation + # @param file_path [Object] Object to be assigned + # @!visibility private + def file_path=(file_path) + if file_path.nil? + fail ArgumentError, 'invalid value for "file_path", file_path cannot be nil.' + end + @file_path = file_path + end + + # Custom attribute writer method with validation + # @param gcp_bucket_name [Object] Object to be assigned + # @!visibility private + def gcp_bucket_name=(gcp_bucket_name) + if gcp_bucket_name.nil? + fail ArgumentError, 'invalid value for "gcp_bucket_name", gcp_bucket_name cannot be nil.' + end + @gcp_bucket_name = gcp_bucket_name + end + + # Custom attribute writer method with validation + # @param gcp_project_id [Object] Object to be assigned + # @!visibility private + def gcp_project_id=(gcp_project_id) + if gcp_project_id.nil? + fail ArgumentError, 'invalid value for "gcp_project_id", gcp_project_id cannot be nil.' + end + @gcp_project_id = gcp_project_id + end + + # Custom attribute writer method with validation + # @param gcp_service_account_email [Object] Object to be assigned + # @!visibility private + def gcp_service_account_email=(gcp_service_account_email) + if gcp_service_account_email.nil? + fail ArgumentError, 'invalid value for "gcp_service_account_email", gcp_service_account_email cannot be nil.' + end + @gcp_service_account_email = gcp_service_account_email + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + file_path == o.file_path && + gcp_bucket_name == o.gcp_bucket_name && + gcp_project_id == o.gcp_project_id && + gcp_service_account_email == o.gcp_service_account_email && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file_path, gcp_bucket_name, gcp_project_id, gcp_service_account_email, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema.rb new file mode 100644 index 00000000000..a9fd105f8a3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema.rb @@ -0,0 +1,148 @@ +=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 + # The definition of `CreateTableRequestDataAttributesSchema` object. + class CreateTableRequestDataAttributesSchema + include BaseGenericModel + + # 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. + attr_reader :primary_keys + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'primary_keys' => :'primary_keys' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Array', + :'primary_keys' => :'Array' + } + 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::CreateTableRequestDataAttributesSchema` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + if (value = attributes[:'fields']).is_a?(Array) + self.fields = value + end + end + + if attributes.key?(:'primary_keys') + if (value = attributes[:'primary_keys']).is_a?(Array) + self.primary_keys = value + end + 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 @fields.nil? + return false if @primary_keys.nil? + true + end + + # Custom attribute writer method with validation + # @param fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + end + + # Custom attribute writer method with validation + # @param primary_keys [Object] Object to be assigned + # @!visibility private + def primary_keys=(primary_keys) + if primary_keys.nil? + fail ArgumentError, 'invalid value for "primary_keys", primary_keys cannot be nil.' + end + @primary_keys = primary_keys + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + fields == o.fields && + primary_keys == o.primary_keys && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, primary_keys, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema_fields_items.rb b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema_fields_items.rb new file mode 100644 index 00000000000..77c01aa424c --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_attributes_schema_fields_items.rb @@ -0,0 +1,144 @@ +=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 + # The definition of `CreateTableRequestDataAttributesSchemaFieldsItems` object. + class CreateTableRequestDataAttributesSchemaFieldsItems + include BaseGenericModel + + # The field name. + attr_reader :name + + # The field type for reference table schema fields. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ReferenceTableSchemaFieldType' + } + 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::CreateTableRequestDataAttributesSchemaFieldsItems` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_table_request_data_type.rb b/lib/datadog_api_client/v2/models/create_table_request_data_type.rb new file mode 100644 index 00000000000..27efaed7dd6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_table_request_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Reference table resource type. + class CreateTableRequestDataType + include BaseEnumModel + + REFERENCE_TABLE = "reference_table".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_request.rb b/lib/datadog_api_client/v2/models/create_upload_request.rb new file mode 100644 index 00000000000..355ffecfcd4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_request.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `CreateUploadRequest` object. + class CreateUploadRequest + include BaseGenericModel + + # The definition of `CreateUploadRequestData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateUploadRequestData' + } + 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::CreateUploadRequest` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_request_data.rb b/lib/datadog_api_client/v2/models/create_upload_request_data.rb new file mode 100644 index 00000000000..9564540dad8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_request_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `CreateUploadRequestData` object. + class CreateUploadRequestData + include BaseGenericModel + + # The definition of `CreateUploadRequestDataAttributes` object. + attr_accessor :attributes + + # The ID of the upload. + attr_accessor :id + + # Upload resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateUploadRequestDataAttributes', + :'id' => :'String', + :'type' => :'CreateUploadRequestDataType' + } + 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::CreateUploadRequestData` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_request_data_attributes.rb b/lib/datadog_api_client/v2/models/create_upload_request_data_attributes.rb new file mode 100644 index 00000000000..a2588889329 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_request_data_attributes.rb @@ -0,0 +1,192 @@ +=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 + # The definition of `CreateUploadRequestDataAttributes` object. + class CreateUploadRequestDataAttributes + include BaseGenericModel + + # The headers of the file to upload. + attr_reader :headers + + # The number of parts in the upload. + attr_reader :part_count + + # The size of each part in the upload in bytes. For multipart uploads (part_count > 1), all parts except the last one must be at least 5,000,000 bytes. For single-part uploads (part_count = 1), any size is allowed. + attr_reader :part_size + + # The name of the reference table. + attr_reader :table_name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'headers' => :'headers', + :'part_count' => :'part_count', + :'part_size' => :'part_size', + :'table_name' => :'table_name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'headers' => :'Array', + :'part_count' => :'Integer', + :'part_size' => :'Integer', + :'table_name' => :'String' + } + 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::CreateUploadRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'headers') + if (value = attributes[:'headers']).is_a?(Array) + self.headers = value + end + end + + if attributes.key?(:'part_count') + self.part_count = attributes[:'part_count'] + end + + if attributes.key?(:'part_size') + self.part_size = attributes[:'part_size'] + end + + if attributes.key?(:'table_name') + self.table_name = attributes[:'table_name'] + 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 @headers.nil? + return false if @part_count.nil? + return false if @part_count > 20 + return false if @part_size.nil? + return false if @table_name.nil? + true + end + + # Custom attribute writer method with validation + # @param headers [Object] Object to be assigned + # @!visibility private + def headers=(headers) + if headers.nil? + fail ArgumentError, 'invalid value for "headers", headers cannot be nil.' + end + @headers = headers + end + + # Custom attribute writer method with validation + # @param part_count [Object] Object to be assigned + # @!visibility private + def part_count=(part_count) + if part_count.nil? + fail ArgumentError, 'invalid value for "part_count", part_count cannot be nil.' + end + if part_count > 20 + fail ArgumentError, 'invalid value for "part_count", must be smaller than or equal to 20.' + end + @part_count = part_count + end + + # Custom attribute writer method with validation + # @param part_size [Object] Object to be assigned + # @!visibility private + def part_size=(part_size) + if part_size.nil? + fail ArgumentError, 'invalid value for "part_size", part_size cannot be nil.' + end + @part_size = part_size + end + + # Custom attribute writer method with validation + # @param table_name [Object] Object to be assigned + # @!visibility private + def table_name=(table_name) + if table_name.nil? + fail ArgumentError, 'invalid value for "table_name", table_name cannot be nil.' + end + @table_name = table_name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + headers == o.headers && + part_count == o.part_count && + part_size == o.part_size && + table_name == o.table_name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [headers, part_count, part_size, table_name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_request_data_type.rb b/lib/datadog_api_client/v2/models/create_upload_request_data_type.rb new file mode 100644 index 00000000000..0f2f7537229 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_request_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Upload resource type. + class CreateUploadRequestDataType + include BaseEnumModel + + UPLOAD = "upload".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_response.rb b/lib/datadog_api_client/v2/models/create_upload_response.rb new file mode 100644 index 00000000000..a49e0ff77f3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_response.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `CreateUploadResponse` object. + class CreateUploadResponse + include BaseGenericModel + + # The definition of `CreateUploadResponseData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'CreateUploadResponseData' + } + 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::CreateUploadResponse` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_response_data.rb b/lib/datadog_api_client/v2/models/create_upload_response_data.rb new file mode 100644 index 00000000000..9c49d6e8890 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_response_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `CreateUploadResponseData` object. + class CreateUploadResponseData + include BaseGenericModel + + # The definition of `CreateUploadResponseDataAttributes` object. + attr_accessor :attributes + + # The ID of the upload. + attr_accessor :id + + # Upload resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'CreateUploadResponseDataAttributes', + :'id' => :'String', + :'type' => :'CreateUploadResponseDataType' + } + 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::CreateUploadResponseData` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_response_data_attributes.rb b/lib/datadog_api_client/v2/models/create_upload_response_data_attributes.rb new file mode 100644 index 00000000000..9eb74ef23b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_response_data_attributes.rb @@ -0,0 +1,107 @@ +=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 + # The definition of `CreateUploadResponseDataAttributes` object. + class CreateUploadResponseDataAttributes + include BaseGenericModel + + # The URLs of the parts in the upload. + attr_accessor :part_urls + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'part_urls' => :'part_urls' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'part_urls' => :'Array' + } + 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::CreateUploadResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'part_urls') + if (value = attributes[:'part_urls']).is_a?(Array) + self.part_urls = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + part_urls == o.part_urls && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [part_urls, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/create_upload_response_data_type.rb b/lib/datadog_api_client/v2/models/create_upload_response_data_type.rb new file mode 100644 index 00000000000..47c56059cdc --- /dev/null +++ b/lib/datadog_api_client/v2/models/create_upload_response_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Upload resource type. + class CreateUploadResponseDataType + include BaseEnumModel + + UPLOAD = "upload".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request.rb b/lib/datadog_api_client/v2/models/patch_table_request.rb new file mode 100644 index 00000000000..5cb5daa99c3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `PatchTableRequest` object. + class PatchTableRequest + include BaseGenericModel + + # The definition of `PatchTableRequestData` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'PatchTableRequestData' + } + 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::PatchTableRequest` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data.rb b/lib/datadog_api_client/v2/models/patch_table_request_data.rb new file mode 100644 index 00000000000..c1598587473 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `PatchTableRequestData` object. + class PatchTableRequestData + include BaseGenericModel + + # The definition of `PatchTableRequestDataAttributes` object. + attr_accessor :attributes + + # The ID of the reference table. + attr_accessor :id + + # Reference table resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'PatchTableRequestDataAttributes', + :'id' => :'String', + :'type' => :'PatchTableRequestDataType' + } + 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::PatchTableRequestData` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes.rb new file mode 100644 index 00000000000..376fc4d42a2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes.rb @@ -0,0 +1,147 @@ +=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 + # The definition of `PatchTableRequestDataAttributes` object. + class PatchTableRequestDataAttributes + include BaseGenericModel + + # The description of the reference table. + attr_accessor :description + + # The definition of `PatchTableRequestDataAttributesFileMetadata` object. + attr_accessor :file_metadata + + # The definition of `PatchTableRequestDataAttributesSchema` object. + attr_accessor :schema + + # Whether this table is synced automatically. + attr_accessor :sync_enabled + + # The tags of the reference table. + attr_accessor :tags + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'description' => :'description', + :'file_metadata' => :'file_metadata', + :'schema' => :'schema', + :'sync_enabled' => :'sync_enabled', + :'tags' => :'tags' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'description' => :'String', + :'file_metadata' => :'PatchTableRequestDataAttributesFileMetadata', + :'schema' => :'PatchTableRequestDataAttributesSchema', + :'sync_enabled' => :'Boolean', + :'tags' => :'Array' + } + 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::PatchTableRequestDataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'file_metadata') + self.file_metadata = attributes[:'file_metadata'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'sync_enabled') + self.sync_enabled = attributes[:'sync_enabled'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + description == o.description && + file_metadata == o.file_metadata && + schema == o.schema && + sync_enabled == o.sync_enabled && + tags == o.tags && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [description, file_metadata, schema, sync_enabled, tags, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata.rb new file mode 100644 index 00000000000..12dee29ce3f --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata.rb @@ -0,0 +1,63 @@ +=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 + # The definition of `PatchTableRequestDataAttributesFileMetadata` object. + module PatchTableRequestDataAttributesFileMetadata + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'PatchTableRequestDataAttributesFileMetadataCloudStorage', + :'PatchTableRequestDataAttributesFileMetadataLocalFile' + ] + 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) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_cloud_storage.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_cloud_storage.rb new file mode 100644 index 00000000000..2b387827de5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_cloud_storage.rb @@ -0,0 +1,90 @@ +=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 + # Cloud storage file metadata for patch requests. Allows partial updates of access_details and sync_enabled. + class PatchTableRequestDataAttributesFileMetadataCloudStorage + include BaseGenericModel + + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails` object. + attr_accessor :access_details + + # 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', + :'sync_enabled' => :'sync_enabled' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'access_details' => :'PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails', + :'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::PatchTableRequestDataAttributesFileMetadataCloudStorage` 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::PatchTableRequestDataAttributesFileMetadataCloudStorage`. 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?(:'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 && + sync_enabled == o.sync_enabled + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [access_details, sync_enabled].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_local_file.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_local_file.rb new file mode 100644 index 00000000000..7317a1040fd --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_local_file.rb @@ -0,0 +1,98 @@ +=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 + # Local file metadata for patch requests using upload ID. + class PatchTableRequestDataAttributesFileMetadataLocalFile + include BaseGenericModel + + # The upload ID. + attr_reader :upload_id + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'upload_id' => :'upload_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'upload_id' => :'String' + } + 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::PatchTableRequestDataAttributesFileMetadataLocalFile` 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::PatchTableRequestDataAttributesFileMetadataLocalFile`. 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?(:'upload_id') + self.upload_id = attributes[:'upload_id'] + 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 @upload_id.nil? + true + end + + # Custom attribute writer method with validation + # @param upload_id [Object] Object to be assigned + # @!visibility private + def upload_id=(upload_id) + if upload_id.nil? + fail ArgumentError, 'invalid value for "upload_id", upload_id cannot be nil.' + end + @upload_id = upload_id + 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 && + upload_id == o.upload_id + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [upload_id].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details.rb new file mode 100644 index 00000000000..6c939ca06f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails` object. + class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails + include BaseGenericModel + + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + attr_accessor :aws_detail + + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + attr_accessor :azure_detail + + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + attr_accessor :gcp_detail + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_detail' => :'aws_detail', + :'azure_detail' => :'azure_detail', + :'gcp_detail' => :'gcp_detail' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_detail' => :'PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail', + :'azure_detail' => :'PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail', + :'gcp_detail' => :'PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + } + 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::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetails` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_detail') + self.aws_detail = attributes[:'aws_detail'] + end + + if attributes.key?(:'azure_detail') + self.azure_detail = attributes[:'azure_detail'] + end + + if attributes.key?(:'gcp_detail') + self.gcp_detail = attributes[:'gcp_detail'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_detail == o.aws_detail && + azure_detail == o.azure_detail && + gcp_detail == o.gcp_detail && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_detail, azure_detail, gcp_detail, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb new file mode 100644 index 00000000000..02ed86ac16f --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_aws_detail.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail + include BaseGenericModel + + # The ID of the AWS account. + attr_accessor :aws_account_id + + # The name of the AWS bucket. + attr_accessor :aws_bucket_name + + # The relative file path from the S3 bucket root to the CSV file. + attr_accessor :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_account_id' => :'aws_account_id', + :'aws_bucket_name' => :'aws_bucket_name', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_account_id' => :'String', + :'aws_bucket_name' => :'String', + :'file_path' => :'String' + } + 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::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAwsDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_bucket_name') + self.aws_bucket_name = attributes[:'aws_bucket_name'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_account_id == o.aws_account_id && + aws_bucket_name == o.aws_bucket_name && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_account_id, aws_bucket_name, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb new file mode 100644 index 00000000000..87ee1c160c5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_azure_detail.rb @@ -0,0 +1,145 @@ +=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 + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail + include BaseGenericModel + + # The Azure client ID. + attr_accessor :azure_client_id + + # The name of the Azure container. + attr_accessor :azure_container_name + + # The name of the Azure storage account. + attr_accessor :azure_storage_account_name + + # The ID of the Azure tenant. + attr_accessor :azure_tenant_id + + # The relative file path from the Azure container root to the CSV file. + attr_accessor :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'azure_client_id' => :'azure_client_id', + :'azure_container_name' => :'azure_container_name', + :'azure_storage_account_name' => :'azure_storage_account_name', + :'azure_tenant_id' => :'azure_tenant_id', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'azure_client_id' => :'String', + :'azure_container_name' => :'String', + :'azure_storage_account_name' => :'String', + :'azure_tenant_id' => :'String', + :'file_path' => :'String' + } + 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::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsAzureDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'azure_client_id') + self.azure_client_id = attributes[:'azure_client_id'] + end + + if attributes.key?(:'azure_container_name') + self.azure_container_name = attributes[:'azure_container_name'] + end + + if attributes.key?(:'azure_storage_account_name') + self.azure_storage_account_name = attributes[:'azure_storage_account_name'] + end + + if attributes.key?(:'azure_tenant_id') + self.azure_tenant_id = attributes[:'azure_tenant_id'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + azure_client_id == o.azure_client_id && + azure_container_name == o.azure_container_name && + azure_storage_account_name == o.azure_storage_account_name && + azure_tenant_id == o.azure_tenant_id && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [azure_client_id, azure_container_name, azure_storage_account_name, azure_tenant_id, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb new file mode 100644 index 00000000000..46f9be35c43 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb @@ -0,0 +1,135 @@ +=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 + # The definition of `PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + class PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail + include BaseGenericModel + + # The relative file path from the GCS bucket root to the CSV file. + attr_accessor :file_path + + # The name of the GCP bucket. + attr_accessor :gcp_bucket_name + + # The ID of the GCP project. + attr_accessor :gcp_project_id + + # The email of the GCP service account. + attr_accessor :gcp_service_account_email + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file_path' => :'file_path', + :'gcp_bucket_name' => :'gcp_bucket_name', + :'gcp_project_id' => :'gcp_project_id', + :'gcp_service_account_email' => :'gcp_service_account_email' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file_path' => :'String', + :'gcp_bucket_name' => :'String', + :'gcp_project_id' => :'String', + :'gcp_service_account_email' => :'String' + } + 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::PatchTableRequestDataAttributesFileMetadataOneOfAccessDetailsGcpDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'gcp_bucket_name') + self.gcp_bucket_name = attributes[:'gcp_bucket_name'] + end + + if attributes.key?(:'gcp_project_id') + self.gcp_project_id = attributes[:'gcp_project_id'] + end + + if attributes.key?(:'gcp_service_account_email') + self.gcp_service_account_email = attributes[:'gcp_service_account_email'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + file_path == o.file_path && + gcp_bucket_name == o.gcp_bucket_name && + gcp_project_id == o.gcp_project_id && + gcp_service_account_email == o.gcp_service_account_email && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file_path, gcp_bucket_name, gcp_project_id, gcp_service_account_email, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema.rb new file mode 100644 index 00000000000..8643995b4b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema.rb @@ -0,0 +1,148 @@ +=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 + # The definition of `PatchTableRequestDataAttributesSchema` object. + class PatchTableRequestDataAttributesSchema + include BaseGenericModel + + # 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. + attr_reader :primary_keys + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'primary_keys' => :'primary_keys' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Array', + :'primary_keys' => :'Array' + } + 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::PatchTableRequestDataAttributesSchema` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + if (value = attributes[:'fields']).is_a?(Array) + self.fields = value + end + end + + if attributes.key?(:'primary_keys') + if (value = attributes[:'primary_keys']).is_a?(Array) + self.primary_keys = value + end + 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 @fields.nil? + return false if @primary_keys.nil? + true + end + + # Custom attribute writer method with validation + # @param fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + end + + # Custom attribute writer method with validation + # @param primary_keys [Object] Object to be assigned + # @!visibility private + def primary_keys=(primary_keys) + if primary_keys.nil? + fail ArgumentError, 'invalid value for "primary_keys", primary_keys cannot be nil.' + end + @primary_keys = primary_keys + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + fields == o.fields && + primary_keys == o.primary_keys && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, primary_keys, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema_fields_items.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema_fields_items.rb new file mode 100644 index 00000000000..d2e8fbf8d10 --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_attributes_schema_fields_items.rb @@ -0,0 +1,144 @@ +=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 + # The definition of `PatchTableRequestDataAttributesSchemaFieldsItems` object. + class PatchTableRequestDataAttributesSchemaFieldsItems + include BaseGenericModel + + # The field name. + attr_reader :name + + # The field type for reference table schema fields. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ReferenceTableSchemaFieldType' + } + 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::PatchTableRequestDataAttributesSchemaFieldsItems` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/patch_table_request_data_type.rb b/lib/datadog_api_client/v2/models/patch_table_request_data_type.rb new file mode 100644 index 00000000000..f54c0dd540c --- /dev/null +++ b/lib/datadog_api_client/v2/models/patch_table_request_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Reference table resource type. + class PatchTableRequestDataType + include BaseEnumModel + + REFERENCE_TABLE = "reference_table".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/reference_table_create_source_type.rb b/lib/datadog_api_client/v2/models/reference_table_create_source_type.rb new file mode 100644 index 00000000000..3ed8fa1a41d --- /dev/null +++ b/lib/datadog_api_client/v2/models/reference_table_create_source_type.rb @@ -0,0 +1,29 @@ +=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 + # The source type for creating reference table data. Only these source types can be created through this API. + class ReferenceTableCreateSourceType + include BaseEnumModel + + LOCAL_FILE = "LOCAL_FILE".freeze + S3 = "S3".freeze + GCS = "GCS".freeze + AZURE = "AZURE".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/reference_table_schema_field_type.rb b/lib/datadog_api_client/v2/models/reference_table_schema_field_type.rb new file mode 100644 index 00000000000..413b3c09b55 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reference_table_schema_field_type.rb @@ -0,0 +1,27 @@ +=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 + # The field type for reference table schema fields. + class ReferenceTableSchemaFieldType + include BaseEnumModel + + STRING = "STRING".freeze + INT32 = "INT32".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/reference_table_sort_type.rb b/lib/datadog_api_client/v2/models/reference_table_sort_type.rb new file mode 100644 index 00000000000..3bad8ab6a3e --- /dev/null +++ b/lib/datadog_api_client/v2/models/reference_table_sort_type.rb @@ -0,0 +1,31 @@ +=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 + # Sort field and direction for reference tables. Use field name for ascending, prefix with "-" for descending. + class ReferenceTableSortType + include BaseEnumModel + + UPDATED_AT = "updated_at".freeze + TABLE_NAME = "table_name".freeze + STATUS = "status".freeze + MINUS_UPDATED_AT = "-updated_at".freeze + MINUS_TABLE_NAME = "-table_name".freeze + MINUS_STATUS = "-status".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/reference_table_source_type.rb b/lib/datadog_api_client/v2/models/reference_table_source_type.rb new file mode 100644 index 00000000000..4ae1707c042 --- /dev/null +++ b/lib/datadog_api_client/v2/models/reference_table_source_type.rb @@ -0,0 +1,33 @@ +=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 + # The source type for reference table data. Includes all possible source types that can appear in responses. + class ReferenceTableSourceType + include BaseEnumModel + + LOCAL_FILE = "LOCAL_FILE".freeze + S3 = "S3".freeze + GCS = "GCS".freeze + AZURE = "AZURE".freeze + SERVICENOW = "SERVICENOW".freeze + SALESFORCE = "SALESFORCE".freeze + DATABRICKS = "DATABRICKS".freeze + SNOWFLAKE = "SNOWFLAKE".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2.rb b/lib/datadog_api_client/v2/models/table_result_v2.rb new file mode 100644 index 00000000000..87ee8534440 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `TableResultV2` object. + class TableResultV2 + include BaseGenericModel + + # The definition of `TableResultV2Data` object. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'TableResultV2Data' + } + 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::TableResultV2` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_array.rb b/lib/datadog_api_client/v2/models/table_result_v2_array.rb new file mode 100644 index 00000000000..7246cb5216f --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_array.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `TableResultV2Array` object. + class TableResultV2Array + include BaseGenericModel + + # The reference tables. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + 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::TableResultV2Array` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data.rb b/lib/datadog_api_client/v2/models/table_result_v2_data.rb new file mode 100644 index 00000000000..7c07a29ef61 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `TableResultV2Data` object. + class TableResultV2Data + include BaseGenericModel + + # The definition of `TableResultV2DataAttributes` object. + attr_accessor :attributes + + # The ID of the reference table. + attr_accessor :id + + # Reference table resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TableResultV2DataAttributes', + :'id' => :'String', + :'type' => :'TableResultV2DataType' + } + 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::TableResultV2Data` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, 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 new file mode 100644 index 00000000000..a4853b78ad4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes.rb @@ -0,0 +1,207 @@ +=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 + # The definition of `TableResultV2DataAttributes` object. + class TableResultV2DataAttributes + include BaseGenericModel + + # UUID of the user who created the reference table. + attr_accessor :created_by + + # The description of the reference table. + attr_accessor :description + + # The definition of `TableResultV2DataAttributesFileMetadata` object. + attr_accessor :file_metadata + + # UUID of the user who last updated the reference table. + attr_accessor :last_updated_by + + # The number of successfully processed rows in the reference table. + attr_accessor :row_count + + # The definition of `TableResultV2DataAttributesSchema` object. + attr_accessor :schema + + # The source type for reference table data. Includes all possible source types that can appear in responses. + attr_accessor :source + + # The status of the reference table. + attr_accessor :status + + # The name of the reference table. + attr_accessor :table_name + + # The tags of the reference table. + attr_accessor :tags + + # The timestamp of the last update to the reference table in ISO 8601 format. + attr_accessor :updated_at + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_by' => :'created_by', + :'description' => :'description', + :'file_metadata' => :'file_metadata', + :'last_updated_by' => :'last_updated_by', + :'row_count' => :'row_count', + :'schema' => :'schema', + :'source' => :'source', + :'status' => :'status', + :'table_name' => :'table_name', + :'tags' => :'tags', + :'updated_at' => :'updated_at' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_by' => :'String', + :'description' => :'String', + :'file_metadata' => :'TableResultV2DataAttributesFileMetadata', + :'last_updated_by' => :'String', + :'row_count' => :'Integer', + :'schema' => :'TableResultV2DataAttributesSchema', + :'source' => :'ReferenceTableSourceType', + :'status' => :'String', + :'table_name' => :'String', + :'tags' => :'Array', + :'updated_at' => :'String' + } + 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::TableResultV2DataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'created_by') + self.created_by = attributes[:'created_by'] + end + + if attributes.key?(:'description') + self.description = attributes[:'description'] + end + + if attributes.key?(:'file_metadata') + self.file_metadata = attributes[:'file_metadata'] + end + + if attributes.key?(:'last_updated_by') + self.last_updated_by = attributes[:'last_updated_by'] + end + + if attributes.key?(:'row_count') + self.row_count = attributes[:'row_count'] + end + + if attributes.key?(:'schema') + self.schema = attributes[:'schema'] + end + + if attributes.key?(:'source') + self.source = attributes[:'source'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'table_name') + self.table_name = attributes[:'table_name'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + created_by == o.created_by && + description == o.description && + file_metadata == o.file_metadata && + last_updated_by == o.last_updated_by && + row_count == o.row_count && + schema == o.schema && + source == o.source && + status == o.status && + table_name == o.table_name && + tags == o.tags && + updated_at == o.updated_at && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_by, description, file_metadata, last_updated_by, row_count, schema, source, status, table_name, tags, updated_at, additional_properties].hash + end + end +end 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 new file mode 100644 index 00000000000..c7451434609 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata.rb @@ -0,0 +1,63 @@ +=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 + # The definition of `TableResultV2DataAttributesFileMetadata` object. + module TableResultV2DataAttributesFileMetadata + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'TableResultV2DataAttributesFileMetadataCloudStorage', + :'TableResultV2DataAttributesFileMetadataLocalFile' + ] + 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) + end + end + 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 new file mode 100644 index 00000000000..de2dc4a226e --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage.rb @@ -0,0 +1,145 @@ +=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 + + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetails` object. + attr_accessor :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 + + attr_accessor :additional_properties + + # 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 + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + 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 + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + additional_properties == o.additional_properties + 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, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage_error_type.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage_error_type.rb new file mode 100644 index 00000000000..8c7a80af8b3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_cloud_storage_error_type.rb @@ -0,0 +1,34 @@ +=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 + # 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. + class TableResultV2DataAttributesFileMetadataCloudStorageErrorType + include BaseEnumModel + + TABLE_SCHEMA_ERROR = "TABLE_SCHEMA_ERROR".freeze + FILE_FORMAT_ERROR = "FILE_FORMAT_ERROR".freeze + CONFIGURATION_ERROR = "CONFIGURATION_ERROR".freeze + QUOTA_EXCEEDED = "QUOTA_EXCEEDED".freeze + CONFLICT_ERROR = "CONFLICT_ERROR".freeze + VALIDATION_ERROR = "VALIDATION_ERROR".freeze + STATE_ERROR = "STATE_ERROR".freeze + OPERATION_ERROR = "OPERATION_ERROR".freeze + SYSTEM_ERROR = "SYSTEM_ERROR".freeze + 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 new file mode 100644 index 00000000000..58d48852f33 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_local_file.rb @@ -0,0 +1,125 @@ +=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. + 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 + + # The upload ID that was used to create/update the table. + attr_accessor :upload_id + + attr_accessor :additional_properties + + # 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', + :'upload_id' => :'upload_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'error_message' => :'String', + :'error_row_count' => :'Integer', + :'upload_id' => :'String' + } + 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 + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + 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?(:'upload_id') + self.upload_id = attributes[:'upload_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + upload_id == o.upload_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [error_message, error_row_count, upload_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details.rb new file mode 100644 index 00000000000..25d0663eece --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetails` object. + class TableResultV2DataAttributesFileMetadataOneOfAccessDetails + include BaseGenericModel + + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + attr_accessor :aws_detail + + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + attr_accessor :azure_detail + + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + attr_accessor :gcp_detail + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_detail' => :'aws_detail', + :'azure_detail' => :'azure_detail', + :'gcp_detail' => :'gcp_detail' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_detail' => :'TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail', + :'azure_detail' => :'TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail', + :'gcp_detail' => :'TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail' + } + 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::TableResultV2DataAttributesFileMetadataOneOfAccessDetails` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_detail') + self.aws_detail = attributes[:'aws_detail'] + end + + if attributes.key?(:'azure_detail') + self.azure_detail = attributes[:'azure_detail'] + end + + if attributes.key?(:'gcp_detail') + self.gcp_detail = attributes[:'gcp_detail'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_detail == o.aws_detail && + azure_detail == o.azure_detail && + gcp_detail == o.gcp_detail && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_detail, azure_detail, gcp_detail, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail.rb new file mode 100644 index 00000000000..7f70596dc54 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_aws_detail.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail` object. + class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail + include BaseGenericModel + + # The ID of the AWS account. + attr_accessor :aws_account_id + + # The name of the AWS bucket. + attr_accessor :aws_bucket_name + + # The relative file path from the S3 bucket root to the CSV file. + attr_accessor :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aws_account_id' => :'aws_account_id', + :'aws_bucket_name' => :'aws_bucket_name', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aws_account_id' => :'String', + :'aws_bucket_name' => :'String', + :'file_path' => :'String' + } + 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::TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAwsDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'aws_account_id') + self.aws_account_id = attributes[:'aws_account_id'] + end + + if attributes.key?(:'aws_bucket_name') + self.aws_bucket_name = attributes[:'aws_bucket_name'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + aws_account_id == o.aws_account_id && + aws_bucket_name == o.aws_bucket_name && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aws_account_id, aws_bucket_name, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail.rb new file mode 100644 index 00000000000..3f0b1639d9a --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_azure_detail.rb @@ -0,0 +1,145 @@ +=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 + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail` object. + class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail + include BaseGenericModel + + # The Azure client ID. + attr_accessor :azure_client_id + + # The name of the Azure container. + attr_accessor :azure_container_name + + # The name of the Azure storage account. + attr_accessor :azure_storage_account_name + + # The ID of the Azure tenant. + attr_accessor :azure_tenant_id + + # The relative file path from the Azure container root to the CSV file. + attr_accessor :file_path + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'azure_client_id' => :'azure_client_id', + :'azure_container_name' => :'azure_container_name', + :'azure_storage_account_name' => :'azure_storage_account_name', + :'azure_tenant_id' => :'azure_tenant_id', + :'file_path' => :'file_path' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'azure_client_id' => :'String', + :'azure_container_name' => :'String', + :'azure_storage_account_name' => :'String', + :'azure_tenant_id' => :'String', + :'file_path' => :'String' + } + 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::TableResultV2DataAttributesFileMetadataOneOfAccessDetailsAzureDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'azure_client_id') + self.azure_client_id = attributes[:'azure_client_id'] + end + + if attributes.key?(:'azure_container_name') + self.azure_container_name = attributes[:'azure_container_name'] + end + + if attributes.key?(:'azure_storage_account_name') + self.azure_storage_account_name = attributes[:'azure_storage_account_name'] + end + + if attributes.key?(:'azure_tenant_id') + self.azure_tenant_id = attributes[:'azure_tenant_id'] + end + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + azure_client_id == o.azure_client_id && + azure_container_name == o.azure_container_name && + azure_storage_account_name == o.azure_storage_account_name && + azure_tenant_id == o.azure_tenant_id && + file_path == o.file_path && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [azure_client_id, azure_container_name, azure_storage_account_name, azure_tenant_id, file_path, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb new file mode 100644 index 00000000000..3de02f8240c --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_file_metadata_one_of_access_details_gcp_detail.rb @@ -0,0 +1,135 @@ +=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 + # The definition of `TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail` object. + class TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail + include BaseGenericModel + + # The relative file path from the GCS bucket root to the CSV file. + attr_accessor :file_path + + # The name of the GCP bucket. + attr_accessor :gcp_bucket_name + + # The ID of the GCP project. + attr_accessor :gcp_project_id + + # The email of the GCP service account. + attr_accessor :gcp_service_account_email + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'file_path' => :'file_path', + :'gcp_bucket_name' => :'gcp_bucket_name', + :'gcp_project_id' => :'gcp_project_id', + :'gcp_service_account_email' => :'gcp_service_account_email' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'file_path' => :'String', + :'gcp_bucket_name' => :'String', + :'gcp_project_id' => :'String', + :'gcp_service_account_email' => :'String' + } + 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::TableResultV2DataAttributesFileMetadataOneOfAccessDetailsGcpDetail` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'file_path') + self.file_path = attributes[:'file_path'] + end + + if attributes.key?(:'gcp_bucket_name') + self.gcp_bucket_name = attributes[:'gcp_bucket_name'] + end + + if attributes.key?(:'gcp_project_id') + self.gcp_project_id = attributes[:'gcp_project_id'] + end + + if attributes.key?(:'gcp_service_account_email') + self.gcp_service_account_email = attributes[:'gcp_service_account_email'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + file_path == o.file_path && + gcp_bucket_name == o.gcp_bucket_name && + gcp_project_id == o.gcp_project_id && + gcp_service_account_email == o.gcp_service_account_email && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [file_path, gcp_bucket_name, gcp_project_id, gcp_service_account_email, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema.rb new file mode 100644 index 00000000000..8deb8d18870 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema.rb @@ -0,0 +1,148 @@ +=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 + # The definition of `TableResultV2DataAttributesSchema` object. + class TableResultV2DataAttributesSchema + include BaseGenericModel + + # 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. + attr_reader :primary_keys + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'fields' => :'fields', + :'primary_keys' => :'primary_keys' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'fields' => :'Array', + :'primary_keys' => :'Array' + } + 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::TableResultV2DataAttributesSchema` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'fields') + if (value = attributes[:'fields']).is_a?(Array) + self.fields = value + end + end + + if attributes.key?(:'primary_keys') + if (value = attributes[:'primary_keys']).is_a?(Array) + self.primary_keys = value + end + 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 @fields.nil? + return false if @primary_keys.nil? + true + end + + # Custom attribute writer method with validation + # @param fields [Object] Object to be assigned + # @!visibility private + def fields=(fields) + if fields.nil? + fail ArgumentError, 'invalid value for "fields", fields cannot be nil.' + end + @fields = fields + end + + # Custom attribute writer method with validation + # @param primary_keys [Object] Object to be assigned + # @!visibility private + def primary_keys=(primary_keys) + if primary_keys.nil? + fail ArgumentError, 'invalid value for "primary_keys", primary_keys cannot be nil.' + end + @primary_keys = primary_keys + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + fields == o.fields && + primary_keys == o.primary_keys && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [fields, primary_keys, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema_fields_items.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema_fields_items.rb new file mode 100644 index 00000000000..538ec6a487e --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_attributes_schema_fields_items.rb @@ -0,0 +1,144 @@ +=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 + # The definition of `TableResultV2DataAttributesSchemaFieldsItems` object. + class TableResultV2DataAttributesSchemaFieldsItems + include BaseGenericModel + + # The field name. + attr_reader :name + + # The field type for reference table schema fields. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ReferenceTableSchemaFieldType' + } + 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::TableResultV2DataAttributesSchemaFieldsItems` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @name.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_result_v2_data_type.rb b/lib/datadog_api_client/v2/models/table_result_v2_data_type.rb new file mode 100644 index 00000000000..ecb792c5464 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_result_v2_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Reference table resource type. + class TableResultV2DataType + include BaseEnumModel + + REFERENCE_TABLE = "reference_table".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/table_row_resource_array.rb b/lib/datadog_api_client/v2/models/table_row_resource_array.rb new file mode 100644 index 00000000000..c27dc8ae9d6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_row_resource_array.rb @@ -0,0 +1,125 @@ +=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 + # The definition of `TableRowResourceArray` object. + class TableRowResourceArray + include BaseGenericModel + + # The rows. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + 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::TableRowResourceArray` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + 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 @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_row_resource_data.rb b/lib/datadog_api_client/v2/models/table_row_resource_data.rb new file mode 100644 index 00000000000..8941378a12c --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_row_resource_data.rb @@ -0,0 +1,143 @@ +=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 + # The definition of `TableRowResourceData` object. + class TableRowResourceData + include BaseGenericModel + + # The definition of `TableRowResourceDataAttributes` object. + attr_accessor :attributes + + # The ID of the row. + attr_accessor :id + + # Row resource type. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'TableRowResourceDataAttributes', + :'id' => :'String', + :'type' => :'TableRowResourceDataType' + } + 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::TableRowResourceData` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + 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 @type.nil? + true + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_row_resource_data_attributes.rb b/lib/datadog_api_client/v2/models/table_row_resource_data_attributes.rb new file mode 100644 index 00000000000..005e25ae3e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_row_resource_data_attributes.rb @@ -0,0 +1,105 @@ +=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 + # The definition of `TableRowResourceDataAttributes` object. + class TableRowResourceDataAttributes + include BaseGenericModel + + # The values of the row. + attr_accessor :values + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'values' => :'values' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'values' => :'Hash' + } + 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::TableRowResourceDataAttributes` initialize method" + end + + self.additional_properties = {} + # 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)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'values') + self.values = attributes[:'values'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + 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 && + values == o.values && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [values, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/table_row_resource_data_type.rb b/lib/datadog_api_client/v2/models/table_row_resource_data_type.rb new file mode 100644 index 00000000000..782e39a9b07 --- /dev/null +++ b/lib/datadog_api_client/v2/models/table_row_resource_data_type.rb @@ -0,0 +1,26 @@ +=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 + # Row resource type. + class TableRowResourceDataType + include BaseEnumModel + + ROW = "row".freeze + end +end